diff --git a/.gitignore b/.gitignore index b127c5da..f751d5e2 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,11 @@ apps/benchmark/results/*.log apps/benchmark/results/*.part*.json # CI-fetched toolchains + pinned m2c (.github/workflows/benchmark.yml) .deps/ +# bench-owned toolchains fetched by `pnpm bench setup` (gcc 2.7.2 + binutils 2.6 releases) +apps/benchmark/toolchains/ +# bench-owned project checkouts materialized by `pnpm bench setup` (disposable clones the +# harness may build in — the sibling WORKSPACE checkouts stay untouched) +apps/benchmark/checkouts/ # per-tier intermediates regenerated by every `bench run` (results.json stays committed) apps/benchmark/results/synthetic.json apps/benchmark/results/real.json diff --git a/README.md b/README.md index a3ae1655..b12728db 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,12 @@ tools: # Possible values: agbcc, ido7.1, gcc2.7.2kmc, mwcc_242_81 target: agbcc + # Optional. The project's built ELF. asmlift reads its symbol table and debug info to + # name the globals and struct fields the assembly only addresses, recover callee + # signatures, and adopt the project's address-cast macro names. How to produce a good + # one is covered in the CLI documentation linked below. + elf: rom.elf + # Optional. Used only for the `--score-against` compiler: | arm-none-eabi-cpp -nostdinc -I tools/agbcc/include {{inputPath}} -o {{outputPath}}.i diff --git a/apps/benchmark/README.md b/apps/benchmark/README.md index 6a7630d0..75295503 100644 --- a/apps/benchmark/README.md +++ b/apps/benchmark/README.md @@ -128,9 +128,37 @@ key derivation is in `src/cache.ts`; the m2c side fails closed on a dirty m2c ch Harness path defaults live in `src/config.ts`, following the sibling-checkout WORKSPACE convention: `ASMLIFT_M2C_DIR` overrides the m2c checkout; `ASMLIFT_CPP` names the GNU cpp used -for real-tier preprocessing (Apple's `/usr/bin/cpp` ignores `-o`). Real-tier manifests carry NO machine paths — each project resolves as -`WORKSPACE/`, overridable per project via `ASMLIFT_PROJ_`; projects missing on -this machine are skipped with one aggregated warning. +for real-tier preprocessing (Apple's `/usr/bin/cpp` ignores `-o`). Real-tier manifests carry NO +machine paths — each project's checkout resolves in order: `ASMLIFT_PROJ_` env override + +> bench-owned checkout (`apps/benchmark/checkouts/`, materialized by `pnpm bench +setup`) > sibling `WORKSPACE/`; projects missing on this machine are skipped with one +> aggregated warning. + +### Bench-owned checkouts (`pnpm bench setup [--build]`) + +`bench setup` materializes a HARNESS-OWNED workspace under the gitignored +`apps/benchmark/checkouts/`: every real-tier fork is cloned at its pinned branch (submodules +included; ssh submodule URLs are rewritten to https), baseroms are copied in from the sibling +user checkout when present, and each project's preparation recipe runs +(`src/cases/project-setup.ts`: agbcc builds, venvs, splat splits, generated sources). +`--build` then runs every project's full build through its own byte-compare gate (plus its +`elfMake` symbol-ELF target). These clones are disposable and freely mutated by the harness; +NON-bench-owned checkouts (env override or sibling WORKSPACE) are only ever reported — setup +never mutates them. + +Host prerequisites (macOS; verified empirically): + +- Xcode CLT (`/usr/bin/cc` — host tools build with `/usr/bin` ahead of homebrew, several + projects' host tools miscompile under homebrew gcc), plus homebrew `gmake`, `wget`, `libpng` +- an `arm-none-eabi` toolchain on PATH (GBA projects: pokeemerald, sa3, kleod) +- python >= 3.11 first on PATH for kleod's `setup.sh`; any python3 for the others +- big-endian `mips-linux-gnu` binutils under `/opt/cross` (af), and Rosetta + (`softwareupdate --install-rosetta` — af's IDO recomp and marioparty3's KMC gcc are x86_64) +- Docker (snowboardkids2 builds inside a linux/amd64 container; the `asmlift-elf` DWARF + sidecar targets also fall back to Docker when no host `mips-linux-gnu-gcc` exists) +- baseroms: setup copies them from the sibling user checkouts when found; otherwise place them + manually (the status table names the missing file and destination) ## Harness layout (`src/`) diff --git a/apps/benchmark/dataset/real/af.json b/apps/benchmark/dataset/real/af.json index 31b521dc..a75881c6 100644 --- a/apps/benchmark/dataset/real/af.json +++ b/apps/benchmark/dataset/real/af.json @@ -2,6 +2,9 @@ "project": "af", "toolchain": "ido7.1", "repoDir": "af", + "repo": "macabeus/af", + "branch": "asmlift-benchmark", + "elfMake": "asmlift-elf", "cppIncludes": [ "-nostdinc" ], @@ -17,7 +20,7 @@ ], "prependC": "typedef struct { unsigned int w0; unsigned int w1; } Gfx;", "funcC": "Gfx* gfxopen(Gfx* gfxHead) {\n return gfxHead + 1;\n}", - "sourceUrl": "https://github.com/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/gfxalloc.c#L4-L6" + "sourceUrl": "https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/gfxalloc.c#L4-L6" }, { "sym": "ListAlloc_Init", @@ -28,7 +31,7 @@ ], "prependC": "#define NULL ((void*)0)\ntypedef struct ListAlloc {\n struct ListAlloc* prev;\n struct ListAlloc* next;\n} ListAlloc;", "funcC": "ListAlloc* ListAlloc_Init(ListAlloc* this) {\n this->prev = NULL;\n this->next = NULL;\n return this;\n}", - "sourceUrl": "https://github.com/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/listalloc.c#L4-L8" + "sourceUrl": "https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/listalloc.c#L4-L8" }, { "sym": "mem_copy", @@ -44,7 +47,7 @@ "returnsVoid": true } }, - "sourceUrl": "https://github.com/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L14-L21" + "sourceUrl": "https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L14-L21" }, { "sym": "mem_clear", @@ -60,7 +63,7 @@ "returnsVoid": true } }, - "sourceUrl": "https://github.com/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L23-L29" + "sourceUrl": "https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L23-L29" }, { "sym": "mem_cmp", @@ -71,7 +74,7 @@ ], "prependC": "typedef unsigned char u8;\ntypedef int s32;\ntypedef unsigned int size_t;", "funcC": "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/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L31-L41" + "sourceUrl": "https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L31-L41" }, { "sym": "chase_s", @@ -82,7 +85,7 @@ ], "prependC": "typedef short s16;\ntypedef int s32;\n#define TRUE 1\n#define FALSE 0", "funcC": "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/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L72-L90" + "sourceUrl": "https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L72-L90" }, { "sym": "chase_s2", @@ -93,7 +96,7 @@ ], "prependC": "typedef short s16;\ntypedef int s32;", "funcC": "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/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L124-L133" + "sourceUrl": "https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L124-L133" }, { "sym": "lbRk_IsLeapMonth", @@ -103,7 +106,7 @@ ], "prependC": "typedef int s32;\n#define lbRk_KYUU_LEAP_MONTH 13", "funcC": "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/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/lb_reki.c#L77-L83" + "sourceUrl": "https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/lb_reki.c#L77-L83" }, { "sym": "lbRk_SeirekiDays", @@ -115,7 +118,7 @@ "prependC": "typedef unsigned char u8;\ntypedef int s32;\ntypedef u8 lbRTC_day_t;\nextern lbRTC_day_t t_seiyo_days_tbl[2][13];", "funcC": "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}", "m2cCtx": true, - "sourceUrl": "https://github.com/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/lb_reki.c#L51-L59" + "sourceUrl": "https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/lb_reki.c#L51-L59" }, { "sym": "lbRk_IsKyuurekiLeapYear", @@ -127,7 +130,7 @@ "prependC": "typedef int s32;\n#define lbRk_YEAR_MIN 2000\nextern s32 l_lbRk_leapdays[33];", "funcC": "s32 lbRk_IsKyuurekiLeapYear(s32 year) {\n if (l_lbRk_leapdays[year - lbRk_YEAR_MIN] != 0) {\n return 1;\n };\n\n return 0;\n}", "m2cCtx": true, - "sourceUrl": "https://github.com/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/lb_reki.c#L69-L75" + "sourceUrl": "https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/lb_reki.c#L69-L75" }, { "sym": "chase_s3", @@ -139,7 +142,7 @@ ], "prependC": "typedef short s16;\ntypedef int s32;\n#define TRUE 1\n#define FALSE 0", "funcC": "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/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L135-L162" + "sourceUrl": "https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L135-L162" }, { "sym": "get_percent", @@ -150,7 +153,7 @@ ], "prependC": "typedef int s32;\ntypedef float f32;", "funcC": "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/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L737-L754" + "sourceUrl": "https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L737-L754" }, { "sym": "check_percent_abs", @@ -161,7 +164,7 @@ ], "prependC": "typedef int s32;\ntypedef float f32;", "funcC": "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/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L652-L671" + "sourceUrl": "https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L652-L671" }, { "sym": "add_calc2", @@ -177,7 +180,7 @@ "returnsVoid": true } }, - "sourceUrl": "https://github.com/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L410-L423" + "sourceUrl": "https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L410-L423" }, { "sym": "add_calc0", @@ -193,7 +196,7 @@ "returnsVoid": true } }, - "sourceUrl": "https://github.com/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L425-L435" + "sourceUrl": "https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L425-L435" }, { "sym": "adds", @@ -209,7 +212,7 @@ "returnsVoid": true } }, - "sourceUrl": "https://github.com/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L565-L580" + "sourceUrl": "https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L565-L580" }, { "sym": "add_calc_short_angle3", @@ -220,7 +223,7 @@ ], "prependC": "typedef short s16;\ntypedef unsigned short u16;\ntypedef int s32;\ntypedef float f32;", "funcC": "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/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L533-L563" + "sourceUrl": "https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L533-L563" }, { "sym": "xyz_t_sub", @@ -236,7 +239,7 @@ "returnsVoid": true } }, - "sourceUrl": "https://github.com/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L242-L246" + "sourceUrl": "https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L242-L246" }, { "sym": "rgba_t_move", @@ -252,7 +255,7 @@ "returnsVoid": true } }, - "sourceUrl": "https://github.com/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L582-L587" + "sourceUrl": "https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L582-L587" }, { "sym": "ValueSet__s_xyz", @@ -268,7 +271,7 @@ "returnsVoid": true } }, - "sourceUrl": "https://github.com/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L357-L364" + "sourceUrl": "https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L357-L364" }, { "sym": "never_zero", @@ -279,7 +282,7 @@ ], "prependC": "typedef float f32;\n#define CLAMP_MAX(x, max) ((x) > (max) ? (max) : (x))\n#define CLAMP_MIN(x, min) ((x) < (min) ? (min) : (x))", "funcC": "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/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_olib.c#L38-L44" + "sourceUrl": "https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_olib.c#L38-L44" }, { "sym": "limiter", @@ -290,7 +293,7 @@ ], "prependC": "typedef float f32;\n#define CLAMP_MAX(x, max) ((x) > (max) ? (max) : (x))\n#define CLAMP_MIN(x, min) ((x) < (min) ? (min) : (x))", "funcC": "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/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_olib.c#L50-L56" + "sourceUrl": "https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_olib.c#L50-L56" }, { "sym": "mRmTp_ItemNo2FtrSize", @@ -302,7 +305,7 @@ "prependC": "typedef unsigned char u8;\ntypedef unsigned short u16;\ntypedef int s32;\n#define UNUSED\nextern u8 mRmTp_ftr_size[];", "funcC": "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}", "m2cCtx": true, - "sourceUrl": "https://github.com/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_room_type.c#L455-L461" + "sourceUrl": "https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_room_type.c#L455-L461" }, { "sym": "chase_angle", @@ -314,7 +317,7 @@ ], "prependC": "typedef short s16;\ntypedef int s32;\ntypedef float f32;\n#define TRUE 1\n#define FALSE 0\nextern f32 game_GameFrame_2F;", "funcC": "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/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L51-L70" + "sourceUrl": "https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L51-L70" }, { "sym": "chase_f", @@ -325,7 +328,7 @@ ], "prependC": "typedef int s32;\ntypedef float f32;\n#define TRUE 1\n#define FALSE 0", "funcC": "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/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L92-L110" + "sourceUrl": "https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L92-L110" }, { "sym": "chase_f3", @@ -336,7 +339,7 @@ ], "prependC": "typedef int s32;\ntypedef float f32;", "funcC": "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/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L175-L194" + "sourceUrl": "https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L175-L194" }, { "sym": "inter_float", @@ -347,7 +350,7 @@ ], "prependC": "typedef int s32;\ntypedef float f32;", "funcC": "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/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L196-L204" + "sourceUrl": "https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L196-L204" }, { "sym": "xyz_t_add", @@ -356,7 +359,7 @@ ], "prependC": "typedef float f32;\ntypedef struct xyz_t { f32 x; f32 y; f32 z; } xyz_t;", "funcC": "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/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L236-L240" + "sourceUrl": "https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L236-L240" }, { "sym": "xyz_t_mult_v", @@ -366,7 +369,7 @@ ], "prependC": "typedef float f32;\ntypedef struct xyz_t { f32 x; f32 y; f32 z; } xyz_t;", "funcC": "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/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L254-L258" + "sourceUrl": "https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L254-L258" }, { "sym": "search_position_angleY", @@ -377,7 +380,7 @@ ], "prependC": "typedef short s16;\ntypedef float f32;\ntypedef struct xyz_t { f32 x; f32 y; f32 z; } xyz_t;\n#define SQ(x) ((x) * (x))\ns16 atans_table(f32 x, f32 y);", "funcC": "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/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L287-L292", + "sourceUrl": "https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L287-L292", "m2cCtx": true }, { @@ -387,7 +390,7 @@ ], "prependC": "typedef short s16;\ntypedef float f32;\ntypedef struct xyz_t { f32 x; f32 y; f32 z; } xyz_t;\ntypedef struct s_xyz { s16 x; s16 y; s16 z; } s_xyz;", "funcC": "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/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L248-L252" + "sourceUrl": "https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L248-L252" }, { "sym": "spolar2world", @@ -398,7 +401,7 @@ ], "prependC": "typedef short s16;\ntypedef float f32;\ntypedef struct xyz_t { f32 x; f32 y; f32 z; } xyz_t;\ntypedef struct { f32 r; s16 pitch; s16 yaw; } VecSphGeo;\ntypedef VecSphGeo VecSph;\nf32 cos_s(s16 angle);\nf32 sin_s(s16 angle);", "funcC": "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/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_olib.c#L82-L97" + "sourceUrl": "https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_olib.c#L82-L97" } ] -} \ No newline at end of file +} diff --git a/apps/benchmark/dataset/real/kleod.json b/apps/benchmark/dataset/real/kleod.json index 814067b7..544a4a2f 100644 --- a/apps/benchmark/dataset/real/kleod.json +++ b/apps/benchmark/dataset/real/kleod.json @@ -2,6 +2,8 @@ "project": "kleod", "toolchain": "agbcc", "repoDir": "klonoa-empire-of-dreams", + "repo": "Dream-Atelier/kl-eod-decomp", + "branch": "asmlift-benchmark", "cppIncludes": [ "-nostdinc", "-I", @@ -21,7 +23,7 @@ "baseline" ], "funcC": "s32 ReturnOne(void) {\n return 1;\n}", - "sourceUrl": "https://github.com/macabeus/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/system.c#L12-L14" + "sourceUrl": "https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/system.c#L12-L14" }, { "sym": "StrCpy", @@ -36,7 +38,7 @@ "returnsVoid": true } }, - "sourceUrl": "https://github.com/macabeus/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/system.c#L16-L25" + "sourceUrl": "https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/system.c#L16-L25" }, { "sym": "MultiplyQ8", @@ -46,7 +48,7 @@ "branch" ], "funcC": "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/macabeus/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/system.c#L116-L127" + "sourceUrl": "https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/system.c#L116-L127" }, { "sym": "MultiplyQ4", @@ -56,7 +58,7 @@ "branch" ], "funcC": "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/macabeus/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/math.c#L25-L36" + "sourceUrl": "https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/math.c#L25-L36" }, { "sym": "DivideQ8", @@ -66,7 +68,7 @@ "shift" ], "funcC": "s16 DivideQ8(s16 num1, s16 num2) {\n return (num1 << 8) / num2;\n}", - "sourceUrl": "https://github.com/macabeus/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/math.c#L11-L13" + "sourceUrl": "https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/math.c#L11-L13" }, { "sym": "ReciprocalQ8", @@ -75,7 +77,7 @@ "soft-div" ], "funcC": "s16 ReciprocalQ8(s16 num1) {\n s32 numerator = 0x10000;\n return (numerator / num1);\n}", - "sourceUrl": "https://github.com/macabeus/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/math.c#L19-L22" + "sourceUrl": "https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/math.c#L19-L22" }, { "sym": "DivideQ4", @@ -85,7 +87,7 @@ "shift" ], "funcC": "s16 DivideQ4(s16 num1, s16 num2) {\n return ((num1 << 4) / num2);\n}", - "sourceUrl": "https://github.com/macabeus/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/math.c#L42-L44" + "sourceUrl": "https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/math.c#L42-L44" }, { "sym": "ReciprocalQ4", @@ -94,7 +96,7 @@ "soft-div" ], "funcC": "s16 ReciprocalQ4(s16 num1) {\n s32 numerator = 0x100;\n return (numerator / num1);\n}", - "sourceUrl": "https://github.com/macabeus/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/math.c#L50-L53" + "sourceUrl": "https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/math.c#L50-L53" }, { "sym": "ReadKeyInput", @@ -110,15 +112,9 @@ "proto": { "ReadKeyInput": { "returnsVoid": true - }, - "SoftResetRom": { - "params": [ - "u8" - ], - "returnsVoid": true } }, - "sourceUrl": "https://github.com/macabeus/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/system.c#L44-L57" + "sourceUrl": "https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/system.c#L44-L57" }, { "sym": "VBlankHandlerMinimal", @@ -132,17 +128,9 @@ "proto": { "VBlankHandlerMinimal": { "returnsVoid": true - }, - "m4aSoundVSync": { - "params": 0, - "returnsVoid": true - }, - "m4aSoundMain": { - "params": 0, - "returnsVoid": true } }, - "sourceUrl": "https://github.com/macabeus/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/math.c#L71-L75" + "sourceUrl": "https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/math.c#L71-L75" }, { "sym": "ReadUnalignedU32", @@ -153,7 +141,7 @@ "memory" ], "funcC": "u32 ReadUnalignedU32(u8 *ptr) {\n return ptr[0] + (ptr[1] << 8) + (ptr[2] << 16) + (ptr[3] << 24);\n}", - "sourceUrl": "https://github.com/macabeus/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/gfx.c#L70-L72" + "sourceUrl": "https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/gfx.c#L70-L72" }, { "sym": "GetEntityLookupData", @@ -171,7 +159,7 @@ } }, "m2cCtx": true, - "sourceUrl": "https://github.com/macabeus/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/code_3.c#L63-L69" + "sourceUrl": "https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/code_3.c#L63-L69" }, { "sym": "UpdateEntities", @@ -186,26 +174,9 @@ "proto": { "UpdateEntities": { "returnsVoid": true - }, - "CheckWorldCompletion": { - "params": [ - "u8" - ] - }, - "CopyWorldMapTiles": { - "params": [ - "u8" - ], - "returnsVoid": true - }, - "UpdateWorldMapNodeTile": { - "params": [ - "u8" - ], - "returnsVoid": true } }, - "sourceUrl": "https://github.com/macabeus/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/code_3.c#L40-L48" + "sourceUrl": "https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/code_3.c#L40-L48" }, { "sym": "GameUpdate", @@ -219,29 +190,9 @@ "proto": { "GameUpdate": { "returnsVoid": true - }, - "UpdateWorldMapNodeState": { - "params": 0, - "returnsVoid": true - }, - "UpdatePlayerInput": { - "params": 0, - "returnsVoid": true - }, - "InitPlayerCollision": { - "params": 0, - "returnsVoid": true - }, - "UpdateWorldMapCursor": { - "params": 0, - "returnsVoid": true - }, - "UpdatePaletteAnimations": { - "params": 0, - "returnsVoid": true } }, - "sourceUrl": "https://github.com/macabeus/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/code_3.c#L165-L173" + "sourceUrl": "https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/code_3.c#L165-L173" }, { "sym": "Decompress", @@ -257,24 +208,9 @@ "proto": { "Decompress": { "returnsVoid": true - }, - "thunk_HeapAlloc": { - "params": 2 - }, - "thunk_HeapFree": { - "params": 1, - "returnsVoid": true - }, - "HuffUnComp": { - "params": 2, - "returnsVoid": true - }, - "LZ77UnCompWram": { - "params": 2, - "returnsVoid": true } }, - "sourceUrl": "https://github.com/macabeus/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/code_3.c#L110-L121" + "sourceUrl": "https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/code_3.c#L110-L121" }, { "sym": "DecompressDma", @@ -290,20 +226,9 @@ "proto": { "DecompressDma": { "returnsVoid": true - }, - "thunk_HeapAlloc": { - "params": 2 - }, - "thunk_HeapFree": { - "params": 1, - "returnsVoid": true - }, - "Decompress": { - "params": 2, - "returnsVoid": true } }, - "sourceUrl": "https://github.com/macabeus/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/code_3.c#L129-L136" + "sourceUrl": "https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/code_3.c#L129-L136" }, { "sym": "CheckTileCollisionVertical", @@ -316,7 +241,7 @@ ], "funcC": "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}", "prependC": "struct Unk_08014184 {\n u16 unk0;\n u8 unk2;\n u8 pad3[0x4 - 0x3];\n};", - "sourceUrl": "https://github.com/macabeus/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/code_1.c#L43-L62" + "sourceUrl": "https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/code_1.c#L43-L62" }, { "sym": "ProcessHBlankWait", @@ -328,7 +253,7 @@ "shift" ], "funcC": "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/macabeus/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/gfx.c#L536-L566" + "sourceUrl": "https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/gfx.c#L536-L566" }, { "sym": "DecompressAlloc", @@ -341,17 +266,8 @@ ], "funcC": "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}", "prependC": "void *thunk_HeapAlloc(u32, u32);\nvoid Decompress(void *, void *);", - "proto": { - "thunk_HeapAlloc": { - "params": 2 - }, - "Decompress": { - "params": 2, - "returnsVoid": true - } - }, "m2cCtx": true, - "sourceUrl": "https://github.com/macabeus/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/code_3.c#L142-L148" + "sourceUrl": "https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/code_3.c#L142-L148" }, { "sym": "WritePaletteColor", @@ -367,12 +283,9 @@ "proto": { "WritePaletteColor": { "returnsVoid": true - }, - "ReadUnalignedU16": { - "params": 1 } }, - "sourceUrl": "https://github.com/macabeus/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/gfx.c#L448-L454" + "sourceUrl": "https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/gfx.c#L448-L454" }, { "sym": "ReadUnalignedU16", @@ -382,7 +295,7 @@ "memory" ], "funcC": "u32 ReadUnalignedU16(u8 *ptr) {\n return ptr[0] | (ptr[1] << 8);\n}", - "sourceUrl": "https://github.com/macabeus/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/gfx.c#L54-L56" + "sourceUrl": "https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/gfx.c#L54-L56" }, { "sym": "FreeAllDecompBuffers", @@ -397,18 +310,10 @@ "proto": { "FreeAllDecompBuffers": { "returnsVoid": true - }, - "thunk_HeapFree": { - "params": 1, - "returnsVoid": true - }, - "m4aSongNumStart": { - "params": 1, - "returnsVoid": true } }, "m2cCtx": true, - "sourceUrl": "https://github.com/macabeus/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/system.c#L91-L110" + "sourceUrl": "https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/system.c#L91-L110" }, { "sym": "DmaSpriteToObjVram", @@ -425,7 +330,7 @@ "returnsVoid": true } }, - "sourceUrl": "https://github.com/macabeus/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/gfx.c#L349-L360" + "sourceUrl": "https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/gfx.c#L349-L360" }, { "sym": "StreamCmd_SetWindowRegs", @@ -441,7 +346,7 @@ "returnsVoid": true } }, - "sourceUrl": "https://github.com/macabeus/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/gfx.c#L667-L676" + "sourceUrl": "https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/gfx.c#L667-L676" }, { "sym": "RollRandomLevelVariant", @@ -458,7 +363,7 @@ "returnsVoid": true } }, - "sourceUrl": "https://github.com/macabeus/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/code_3.c#L80-L89" + "sourceUrl": "https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/code_3.c#L80-L89" }, { "sym": "TransformSingleEntityToScreen", @@ -470,7 +375,7 @@ "arithmetic" ], "funcC": "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/macabeus/kl-eod-decomp/blob/ebe9bd0eccaa3a763a96321af92e17fdede003c4/src/code_0.c#L1407-L1464" + "sourceUrl": "https://github.com/Dream-Atelier/kl-eod-decomp/blob/9400132178f58db2d8b2638349ffa86155ed2e53/src/code_0.c#L1407-L1464" }, { "sym": "CopyBGScrollTiles", @@ -481,7 +386,7 @@ "branch" ], "funcC": "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/macabeus/kl-eod-decomp/blob/ebe9bd0eccaa3a763a96321af92e17fdede003c4/src/code_1.c#L1165-L1180", + "sourceUrl": "https://github.com/Dream-Atelier/kl-eod-decomp/blob/ed09229e28615a1bd585a5be6b1a9ba2c8a77315/src/code_1.c#L1165-L1180", "m2cCtx": true }, { @@ -493,7 +398,7 @@ "soft-div" ], "funcC": "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/macabeus/kl-eod-decomp/blob/ebe9bd0eccaa3a763a96321af92e17fdede003c4/src/code_1.c#L1184-L1218", + "sourceUrl": "https://github.com/Dream-Atelier/kl-eod-decomp/blob/ed09229e28615a1bd585a5be6b1a9ba2c8a77315/src/code_1.c#L1184-L1218", "m2cCtx": true }, { @@ -506,7 +411,7 @@ "branch" ], "funcC": "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/macabeus/kl-eod-decomp/blob/ebe9bd0eccaa3a763a96321af92e17fdede003c4/src/code_3.c#L1752-L1791" + "sourceUrl": "https://github.com/Dream-Atelier/kl-eod-decomp/blob/ed09229e28615a1bd585a5be6b1a9ba2c8a77315/src/code_3.c#L1752-L1791" }, { "sym": "UpdateWorldMapNodeTile", @@ -517,7 +422,7 @@ "table" ], "funcC": "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/macabeus/kl-eod-decomp/blob/ebe9bd0eccaa3a763a96321af92e17fdede003c4/src/code_3.c#L1849-L1870", + "sourceUrl": "https://github.com/Dream-Atelier/kl-eod-decomp/blob/ed09229e28615a1bd585a5be6b1a9ba2c8a77315/src/code_3.c#L1849-L1870", "m2cCtx": true }, { @@ -528,7 +433,7 @@ "call" ], "funcC": "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/macabeus/kl-eod-decomp/blob/ebe9bd0eccaa3a763a96321af92e17fdede003c4/src/engine.c#L48-L56", + "sourceUrl": "https://github.com/Dream-Atelier/kl-eod-decomp/blob/ed09229e28615a1bd585a5be6b1a9ba2c8a77315/src/engine.c#L48-L56", "m2cCtx": true }, { @@ -540,7 +445,7 @@ "call" ], "funcC": "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/macabeus/kl-eod-decomp/blob/ebe9bd0eccaa3a763a96321af92e17fdede003c4/src/gfx.c#L429-L440" + "sourceUrl": "https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/gfx.c#L429-L440" } ] -} \ No newline at end of file +} diff --git a/apps/benchmark/dataset/real/marioparty3.json b/apps/benchmark/dataset/real/marioparty3.json index bc75d8c1..017e2b74 100644 --- a/apps/benchmark/dataset/real/marioparty3.json +++ b/apps/benchmark/dataset/real/marioparty3.json @@ -3,6 +3,9 @@ "note": "Mario Party 3 (N64) matched functions, compiled with mainline GCC 2.7.2 at -O1 (the project's own tools/gcc_2.7.2). Project headers preprocess under host cpp, so funcC uses common.h types + per-function extern decls for file-local globals; include_asm.h's top-level `asm(\".include ...\")` (the INCLUDE_ASM machinery) is stripped at preprocess so the vendored object is self-contained.", "toolchain": "gcc2.7.2", "repoDir": "marioparty3", + "repo": "macabeus/marioparty3", + "branch": "asmlift-benchmark", + "elfMake": "asmlift-elf", "cppIncludes": [ "-nostdinc", "-I", @@ -37,7 +40,7 @@ "arithmetic" ], "funcC": "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/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/window.c#L325-L334", + "sourceUrl": "https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/window.c#L325-L334", "prependC": "extern TextWindow *D_800CC69C_CD29C;", "m2cCtx": true, "proto": { @@ -57,7 +60,7 @@ "arithmetic" ], "funcC": "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/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/pause.c#L61-L73", + "sourceUrl": "https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/pause.c#L61-L73", "prependC": "extern MinigameTable D_800A6D44_A7944[];", "m2cCtx": true, "proto": { @@ -72,7 +75,7 @@ "global" ], "funcC": "void func_800123F4_12FF4(void) {\n D_800D418E_D4D8E = D_800D2008_D2C08;\n}", - "sourceUrl": "https://github.com/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/camera.c#L53-L55", + "sourceUrl": "https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/camera.c#L53-L55", "prependC": "extern s16 D_800D418E_D4D8E;\nextern u8 D_800D2008_D2C08;", "m2cCtx": true, "proto": { @@ -89,7 +92,7 @@ "arithmetic" ], "funcC": "void func_8000F088_FC88(s32 *uCodeAdresses) {\n gUCodeAddresses = uCodeAdresses;\n}", - "sourceUrl": "https://github.com/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/graphics.c#L245-L247", + "sourceUrl": "https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/graphics.c#L245-L247", "prependC": "extern s32 *gUCodeAddresses;", "m2cCtx": true, "proto": { @@ -108,7 +111,7 @@ "arithmetic" ], "funcC": "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/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/malloc.c#L139-L153", + "sourceUrl": "https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/malloc.c#L139-L153", "m2cCtx": true }, { @@ -121,7 +124,7 @@ "arithmetic" ], "funcC": "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/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/sprman.c#L823-L834", + "sourceUrl": "https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/sprman.c#L823-L834", "prependC": "extern HuSprAnmDesc *D_800D0A50_D1650[0x100];", "m2cCtx": true, "proto": { @@ -136,7 +139,7 @@ "global" ], "funcC": "void func_8001D330_1DF30(s16 arg0) {\n D_800A0A78_A1678 = arg0;\n}", - "sourceUrl": "https://github.com/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/hmfman.c#L525-L527", + "sourceUrl": "https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/hmfman.c#L525-L527", "prependC": "extern s16 D_800A0A78_A1678;", "m2cCtx": true, "proto": { @@ -154,7 +157,7 @@ "arithmetic" ], "funcC": "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/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/hmfman.c#L615-L624", + "sourceUrl": "https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/hmfman.c#L615-L624", "m2cCtx": true, "proto": { "func_8001FBBC_207BC": { @@ -171,7 +174,7 @@ "arithmetic" ], "funcC": "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/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/malloc.c#L158-L170", + "sourceUrl": "https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/malloc.c#L158-L170", "m2cCtx": true }, { @@ -183,7 +186,7 @@ "arithmetic" ], "funcC": "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/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/pause.c#L217-L230", + "sourceUrl": "https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/pause.c#L217-L230", "prependC": "extern u8 D_800A1590_A2190[];", "m2cCtx": true }, @@ -195,7 +198,7 @@ "arithmetic" ], "funcC": "void func_8002FD48_30948(HmfData *arg0) {\n arg0->unkA0 = 0;\n}", - "sourceUrl": "https://github.com/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/22EB0.c#L208-L210", + "sourceUrl": "https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/22EB0.c#L208-L210", "m2cCtx": true, "proto": { "func_8002FD48_30948": { @@ -211,7 +214,7 @@ "arithmetic" ], "funcC": "void func_80071B40_72740(ALVoice *voice, s16 priority) {\n voice->priority = priority;\n}", - "sourceUrl": "https://github.com/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/72740.c#L3-L5", + "sourceUrl": "https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/72740.c#L3-L5", "m2cCtx": true, "proto": { "func_80071B40_72740": { @@ -225,7 +228,7 @@ "global" ], "funcC": "s8 func_8006014C_60D4C(s32 winId) {\n return D_800CC69C_CD29C[winId].unk_31;\n}", - "sourceUrl": "https://github.com/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/window.c#L345-L347", + "sourceUrl": "https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/window.c#L345-L347", "prependC": "extern TextWindow *D_800CC69C_CD29C;", "m2cCtx": true }, @@ -239,7 +242,7 @@ "arithmetic" ], "funcC": "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/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/window.c#L297-L313", + "sourceUrl": "https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/window.c#L297-L313", "prependC": "extern u8 *D_800A2344_A2F44[];\nextern u8 D_800A232C_A2F2C[];", "m2cCtx": true }, @@ -251,7 +254,7 @@ "arithmetic" ], "funcC": "void func_80047E90_48A90(omObjData *obj, s32 arg1) {\n obj->unk10 |= arg1;\n}", - "sourceUrl": "https://github.com/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/objmain.c#L516-L518", + "sourceUrl": "https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/objmain.c#L516-L518", "m2cCtx": true, "proto": { "func_80047E90_48A90": { @@ -267,7 +270,7 @@ "arithmetic" ], "funcC": "void *func_80056254_56E54(HuSprite_Unk84_Struct **arg0) {\n return (*arg0)->unk0C;\n}", - "sourceUrl": "https://github.com/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/sprman.c#L676-L678", + "sourceUrl": "https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/sprman.c#L676-L678", "m2cCtx": true, "proto": { "func_80056254_56E54": { @@ -284,7 +287,7 @@ "arithmetic" ], "funcC": "HuSprite_Unk84_Unk00_Struct *func_800560D8_56CD8(s16 arg0, u16 arg1) {\n return &D_800C9530_CA130[arg0]->unk00[arg1];\n}", - "sourceUrl": "https://github.com/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/sprman.c#L636-L638", + "sourceUrl": "https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/sprman.c#L636-L638", "prependC": "extern HuSprite_Unk84_Struct *D_800C9530_CA130[];", "m2cCtx": true }, @@ -296,7 +299,7 @@ "arithmetic" ], "funcC": "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/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/8ACD0.c#L3-L18", + "sourceUrl": "https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/8ACD0.c#L3-L18", "m2cCtx": true, "proto": { "func_8008A0D0_8ACD0": { @@ -310,7 +313,7 @@ "global" ], "funcC": "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/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/objmain.c#L1053-L1057", + "sourceUrl": "https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/objmain.c#L1053-L1057", "prependC": "extern s16 D_800A1780_A2380;\nextern s8 D_800D1710_D2310;\nextern u16 D_800D0A3A_D163A;", "m2cCtx": true, "proto": { @@ -328,7 +331,7 @@ "arithmetic" ], "funcC": "void *func_80056260_56E60(s16 arg0) {\n return D_800C9530_CA130[arg0]->unk0C;\n}", - "sourceUrl": "https://github.com/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/sprman.c#L680-L682", + "sourceUrl": "https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/sprman.c#L680-L682", "prependC": "extern HuSprite_Unk84_Struct *D_800C9530_CA130[];", "m2cCtx": true, "proto": { @@ -345,7 +348,7 @@ "arithmetic" ], "funcC": "void func_8000F04C_FC4C(u64 **threadStacks) {\n gThread3Stack = *threadStacks++;\n gThreadOutStack = *threadStacks++;\n gThreadOutStackSize = *threadStacks++;\n gThreadYieldStack = *threadStacks;\n}", - "sourceUrl": "https://github.com/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/graphics.c#L237-L242", + "sourceUrl": "https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/graphics.c#L237-L242", "prependC": "extern s32 gThreadOutStack;\nextern s32 gThreadOutStackSize;\nextern s32 gThreadYieldStack;\nextern u64 *gThread3Stack;", "m2cCtx": true, "proto": { @@ -363,7 +366,7 @@ "arithmetic" ], "funcC": "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/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/sprman.c#L650-L654", + "sourceUrl": "https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/sprman.c#L650-L654", "prependC": "extern HuSprite_Unk84_Struct *D_800C9530_CA130[];", "m2cCtx": true, "proto": { @@ -378,7 +381,7 @@ "arithmetic" ], "funcC": "void GWMgNoSet(s8 arg0) {\n GwSystem.minigame_index = arg0;\n}", - "sourceUrl": "https://github.com/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/save.c#L17-L19", + "sourceUrl": "https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/save.c#L17-L19", "proto": { "GWMgNoSet": { "returnsVoid": true @@ -391,7 +394,7 @@ "global" ], "funcC": "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/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/objmain.c#L1059-L1065", + "sourceUrl": "https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/objmain.c#L1059-L1065", "prependC": "extern s16 D_800A1780_A2380;\nextern u16 D_800CD2F4_CDEF4;\nextern u16 D_800D0A3A_D163A;\nextern u16 D_800D4082_D4C82;\nextern u16 D_800D6A56_D7656;", "m2cCtx": true, "proto": { @@ -409,7 +412,7 @@ "arithmetic" ], "funcC": "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/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/camera.c#L72-L78", + "sourceUrl": "https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/camera.c#L72-L78", "prependC": "extern HuCamera *gCameraList;", "m2cCtx": true, "proto": { @@ -425,7 +428,7 @@ "arithmetic" ], "funcC": "void func_8000F024_FC24(void **pool, u16 size, u16 segment) {\n frameBufferPool = pool;\n frameBufferCount = size;\n frameBufferSegmentID = segment;\n}", - "sourceUrl": "https://github.com/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/graphics.c#L225-L229", + "sourceUrl": "https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/graphics.c#L225-L229", "prependC": "extern u16 frameBufferCount;\nextern u16 frameBufferSegmentID;\nextern void **frameBufferPool;", "proto": { "func_8000F024_FC24": { @@ -440,7 +443,7 @@ "arithmetic" ], "funcC": "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/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/gamemes.c#L743-L752", + "sourceUrl": "https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/gamemes.c#L743-L752", "prependC": "extern s32 omovl;" }, { @@ -450,7 +453,7 @@ "arithmetic" ], "funcC": "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/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/sprman.c#L777-L783" + "sourceUrl": "https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/sprman.c#L777-L783" }, { "sym": "UnlinkProcess", @@ -461,7 +464,7 @@ "arithmetic" ], "funcC": "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/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/process.c#L45-L54", + "sourceUrl": "https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/process.c#L45-L54", "m2cCtx": true, "proto": { "UnlinkProcess": { @@ -477,7 +480,7 @@ "arithmetic" ], "funcC": "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/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/hmfload.c#L31-L43" + "sourceUrl": "https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/hmfload.c#L31-L43" }, { "sym": "func_80052E14_53A14", @@ -487,7 +490,7 @@ "arithmetic" ], "funcC": "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/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/sprman.c#L213-L225", + "sourceUrl": "https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/sprman.c#L213-L225", "m2cCtx": true, "proto": { "func_80052E14_53A14": { @@ -503,7 +506,7 @@ "arithmetic" ], "funcC": "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/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/save.c#L80-L91" + "sourceUrl": "https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/save.c#L80-L91" } ] } diff --git a/apps/benchmark/dataset/real/pokeemerald.json b/apps/benchmark/dataset/real/pokeemerald.json index f051e690..a5460c7d 100644 --- a/apps/benchmark/dataset/real/pokeemerald.json +++ b/apps/benchmark/dataset/real/pokeemerald.json @@ -2,6 +2,9 @@ "project": "pokeemerald", "toolchain": "agbcc", "repoDir": "pokeemerald", + "repo": "macabeus/pokeemerald", + "branch": "asmlift-benchmark", + "elfMake": "asmlift-elf", "cppIncludes": [ "-nostdinc", "-undef", @@ -28,7 +31,7 @@ "soft-div" ], "funcC": "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/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/math_util.c#L3-L11" + "sourceUrl": "https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/math_util.c#L3-L11" }, { "sym": "MathUtil_Mul16Shift", @@ -39,7 +42,7 @@ "shift" ], "funcC": "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/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/math_util.c#L13-L21" + "sourceUrl": "https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/math_util.c#L13-L21" }, { "sym": "MathUtil_Mul32", @@ -50,7 +53,7 @@ "soft-div" ], "funcC": "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/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/math_util.c#L23-L31" + "sourceUrl": "https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/math_util.c#L23-L31" }, { "sym": "MathUtil_Div16", @@ -61,7 +64,7 @@ "shift" ], "funcC": "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/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/math_util.c#L33-L40" + "sourceUrl": "https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/math_util.c#L33-L40" }, { "sym": "MathUtil_Div16Shift", @@ -72,7 +75,7 @@ "shift" ], "funcC": "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/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/math_util.c#L42-L49" + "sourceUrl": "https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/math_util.c#L42-L49" }, { "sym": "MathUtil_Inv16", @@ -81,7 +84,7 @@ "soft-div" ], "funcC": "s16 MathUtil_Inv16(s16 y)\n{\n s32 x;\n\n x = 0x10000;\n return x / y;\n}", - "sourceUrl": "https://github.com/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/math_util.c#L64-L70" + "sourceUrl": "https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/math_util.c#L64-L70" }, { "sym": "StoreWordInTwoHalfwords", @@ -97,7 +100,7 @@ "returnsVoid": true } }, - "sourceUrl": "https://github.com/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/util.c#L127-L131" + "sourceUrl": "https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/util.c#L127-L131" }, { "sym": "LoadWordFromTwoHalfwords", @@ -114,7 +117,7 @@ "returnsVoid": true } }, - "sourceUrl": "https://github.com/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/util.c#L133-L136" + "sourceUrl": "https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/util.c#L133-L136" }, { "sym": "CountTrailingZeroBits", @@ -125,7 +128,7 @@ "shift" ], "funcC": "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/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/util.c#L208-L220" + "sourceUrl": "https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/util.c#L208-L220" }, { "sym": "CalcByteArraySum", @@ -136,7 +139,7 @@ "array" ], "funcC": "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/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/util.c#L256-L262" + "sourceUrl": "https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/util.c#L256-L262" }, { "sym": "CalcCRC16", @@ -147,7 +150,7 @@ "nested-loop" ], "funcC": "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/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/util.c#L222-L239" + "sourceUrl": "https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/util.c#L222-L239" }, { "sym": "Random", @@ -159,7 +162,7 @@ ], "funcC": "u16 Random(void)\n{\n gRngValue = ISO_RANDOMIZE1(gRngValue);\n sRandCount++;\n return gRngValue >> 16;\n}", "prependC": "#include \"random.h\"\nstatic u32 sRandCount;", - "sourceUrl": "https://github.com/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/random.c#L11-L16" + "sourceUrl": "https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/random.c#L11-L16" }, { "sym": "StringLength", @@ -171,7 +174,7 @@ ], "funcC": "u16 StringLength(const u8 *str)\n{\n u16 length = 0;\n\n while (str[length] != EOS)\n length++;\n\n return length;\n}", "prependC": "#include \"constants/characters.h\"", - "sourceUrl": "https://github.com/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/string_util.c#L114-L122" + "sourceUrl": "https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/string_util.c#L114-L122" }, { "sym": "StringCompare", @@ -183,7 +186,7 @@ ], "funcC": "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}", "prependC": "#include \"constants/characters.h\"", - "sourceUrl": "https://github.com/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/string_util.c#L124-L135" + "sourceUrl": "https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/string_util.c#L124-L135" }, { "sym": "StringCompareN", @@ -195,7 +198,7 @@ ], "funcC": "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}", "prependC": "#include \"constants/characters.h\"", - "sourceUrl": "https://github.com/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/string_util.c#L137-L150" + "sourceUrl": "https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/string_util.c#L137-L150" }, { "sym": "StringCopy", @@ -206,7 +209,7 @@ ], "funcC": "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}", "prependC": "#include \"constants/characters.h\"", - "sourceUrl": "https://github.com/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/string_util.c#L75-L86" + "sourceUrl": "https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/string_util.c#L75-L86" }, { "sym": "StringAppend", @@ -218,13 +221,8 @@ ], "funcC": "u8 *StringAppend(u8 *dest, const u8 *src)\n{\n while (*dest != EOS)\n dest++;\n\n return StringCopy(dest, src);\n}", "prependC": "#include \"constants/characters.h\"\nu8 *StringCopy(u8 *dest, const u8 *src);", - "proto": { - "StringCopy": { - "params": 2 - } - }, "m2cCtx": true, - "sourceUrl": "https://github.com/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/string_util.c#L88-L94" + "sourceUrl": "https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/string_util.c#L88-L94" }, { "sym": "IsStringLengthAtLeast", @@ -236,7 +234,7 @@ ], "funcC": "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}", "prependC": "#include \"constants/characters.h\"", - "sourceUrl": "https://github.com/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/string_util.c#L152-L161" + "sourceUrl": "https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/string_util.c#L152-L161" }, { "sym": "StringCopyN", @@ -246,7 +244,7 @@ "array" ], "funcC": "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/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/string_util.c#L96-L104" + "sourceUrl": "https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/string_util.c#L96-L104" }, { "sym": "CalcCRC16WithTable", @@ -260,7 +258,7 @@ "funcC": "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}", "prependC": "static const u16 sCrc16Table[] = {0x0000,0x1189,0x2312,0x329B,0x4624,0x57AD,0x6536,0x74BF,0x8C48,0x9DC1,0xAF5A,0xBED3,0xCA6C,0xDBE5,0xE97E,0xF8F7,0x1081,0x0108,0x3393,0x221A,0x56A5,0x472C,0x75B7,0x643E,0x9CC9,0x8D40,0xBFDB,0xAE52,0xDAED,0xCB64,0xF9FF,0xE876,0x2102,0x308B,0x0210,0x1399,0x6726,0x76AF,0x4434,0x55BD,0xAD4A,0xBCC3,0x8E58,0x9FD1,0xEB6E,0xFAE7,0xC87C,0xD9F5,0x3183,0x200A,0x1291,0x0318,0x77A7,0x662E,0x54B5,0x453C,0xBDCB,0xAC42,0x9ED9,0x8F50,0xFBEF,0xEA66,0xD8FD,0xC974,0x4204,0x538D,0x6116,0x709F,0x0420,0x15A9,0x2732,0x36BB,0xCE4C,0xDFC5,0xED5E,0xFCD7,0x8868,0x99E1,0xAB7A,0xBAF3,0x5285,0x430C,0x7197,0x601E,0x14A1,0x0528,0x37B3,0x263A,0xDECD,0xCF44,0xFDDF,0xEC56,0x98E9,0x8960,0xBBFB,0xAA72,0x6306,0x728F,0x4014,0x519D,0x2522,0x34AB,0x0630,0x17B9,0xEF4E,0xFEC7,0xCC5C,0xDDD5,0xA96A,0xB8E3,0x8A78,0x9BF1,0x7387,0x620E,0x5095,0x411C,0x35A3,0x242A,0x16B1,0x0738,0xFFCF,0xEE46,0xDCDD,0xCD54,0xB9EB,0xA862,0x9AF9,0x8B70,0x8408,0x9581,0xA71A,0xB693,0xC22C,0xD3A5,0xE13E,0xF0B7,0x0840,0x19C9,0x2B52,0x3ADB,0x4E64,0x5FED,0x6D76,0x7CFF,0x9489,0x8500,0xB79B,0xA612,0xD2AD,0xC324,0xF1BF,0xE036,0x18C1,0x0948,0x3BD3,0x2A5A,0x5EE5,0x4F6C,0x7DF7,0x6C7E,0xA50A,0xB483,0x8618,0x9791,0xE32E,0xF2A7,0xC03C,0xD1B5,0x2942,0x38CB,0x0A50,0x1BD9,0x6F66,0x7EEF,0x4C74,0x5DFD,0xB58B,0xA402,0x9699,0x8710,0xF3AF,0xE226,0xD0BD,0xC134,0x39C3,0x284A,0x1AD1,0x0B58,0x7FE7,0x6E6E,0x5CF5,0x4D7C,0xC60C,0xD785,0xE51E,0xF497,0x8028,0x91A1,0xA33A,0xB2B3,0x4A44,0x5BCD,0x6956,0x78DF,0x0C60,0x1DE9,0x2F72,0x3EFB,0xD68D,0xC704,0xF59F,0xE416,0x90A9,0x8120,0xB3BB,0xA232,0x5AC5,0x4B4C,0x79D7,0x685E,0x1CE1,0x0D68,0x3FF3,0x2E7A,0xE70E,0xF687,0xC41C,0xD595,0xA12A,0xB0A3,0x8238,0x93B1,0x6B46,0x7ACF,0x4854,0x59DD,0x2D62,0x3CEB,0x0E70,0x1FF9,0xF78F,0xE606,0xD49D,0xC514,0xB1AB,0xA022,0x92B9,0x8330,0x7BC7,0x6A4E,0x58D5,0x495C,0x3DE3,0x2C6A,0x1EF1,0x0F78};", "m2cCtx": true, - "sourceUrl": "https://github.com/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/util.c#L241-L254" + "sourceUrl": "https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/util.c#L241-L254" }, { "sym": "ModifyStatByNature", @@ -273,7 +271,7 @@ ], "funcC": "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}", "m2cCtx": true, - "sourceUrl": "https://github.com/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/pokemon.c#L5864-L5898" + "sourceUrl": "https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/pokemon.c#L5864-L5898" }, { "sym": "GetGenderFromSpeciesAndPersonality", @@ -285,7 +283,7 @@ ], "funcC": "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}", "m2cCtx": true, - "sourceUrl": "https://github.com/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/pokemon.c#L3471-L3485" + "sourceUrl": "https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/pokemon.c#L3471-L3485" }, { "sym": "Sin2", @@ -299,7 +297,7 @@ "funcC": "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}", "prependC": "extern const s16 gSineDegreeTable[];", "m2cCtx": true, - "sourceUrl": "https://github.com/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/trig.c#L527-L537" + "sourceUrl": "https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/trig.c#L527-L537" }, { "sym": "Cos2", @@ -309,12 +307,7 @@ ], "funcC": "s16 Cos2(u16 angle)\n{\n return Sin2(angle + 90);\n}", "prependC": "s16 Sin2(u16 angle);", - "proto": { - "Sin2": { - "params": 1 - } - }, - "sourceUrl": "https://github.com/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/trig.c#L540-L543" + "sourceUrl": "https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/trig.c#L540-L543" }, { "sym": "PutMemBlockHeader", @@ -330,7 +323,7 @@ "returnsVoid": true } }, - "sourceUrl": "https://github.com/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/malloc.c#L31-L40" + "sourceUrl": "https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/malloc.c#L31-L40" }, { "sym": "PutFirstMemBlockHeader", @@ -344,14 +337,10 @@ "proto": { "PutFirstMemBlockHeader": { "returnsVoid": true - }, - "PutMemBlockHeader": { - "returnsVoid": true, - "params": 4 } }, "m2cCtx": true, - "sourceUrl": "https://github.com/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/malloc.c#L42-L45" + "sourceUrl": "https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/malloc.c#L42-L45" }, { "sym": "StopScript", @@ -368,7 +357,7 @@ "returnsVoid": true } }, - "sourceUrl": "https://github.com/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/script.c#L65-L69" + "sourceUrl": "https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/script.c#L65-L69" }, { "sym": "SetupBytecodeScript", @@ -379,7 +368,7 @@ ], "funcC": "u8 SetupBytecodeScript(struct ScriptContext *ctx, const u8 *ptr)\n{\n ctx->scriptPtr = ptr;\n ctx->mode = SCRIPT_MODE_BYTECODE;\n return 1;\n}", "prependC": "#include \"script.h\"\nenum {\n SCRIPT_MODE_STOPPED,\n SCRIPT_MODE_BYTECODE,\n SCRIPT_MODE_NATIVE,\n};", - "sourceUrl": "https://github.com/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/script.c#L52-L57" + "sourceUrl": "https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/script.c#L52-L57" }, { "sym": "TranslateBigMonSizeTableIndex", @@ -392,7 +381,7 @@ ], "funcC": "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}", "prependC": "struct UnknownStruct\n{\n u16 unk0;\n u8 unk2;\n u16 unk4;\n};\n\nstatic const struct UnknownStruct sBigMonSizeTable[] =\n{\n { 290, 1, 0 },\n { 300, 1, 10 },\n { 400, 2, 110 },\n { 500, 4, 310 },\n { 600, 20, 710 },\n { 700, 50, 2710 },\n { 800, 100, 7710 },\n { 900, 150, 17710 },\n { 1000, 150, 32710 },\n { 1100, 100, -17826 },\n { 1200, 50, -7826 },\n { 1300, 20, -2826 },\n { 1400, 5, -826 },\n { 1500, 2, -326 },\n { 1600, 1, -126 },\n { 1700, 1, -26 },\n};", - "sourceUrl": "https://github.com/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/pokemon_size_record.c#L67-L77" + "sourceUrl": "https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/pokemon_size_record.c#L67-L77" }, { "sym": "FeebasRandom", @@ -403,7 +392,7 @@ ], "funcC": "static u16 FeebasRandom(void)\n{\n sFeebasRngValue = ISO_RANDOMIZE2(sFeebasRngValue);\n return sFeebasRngValue >> 16;\n}", "prependC": "#include \"random.h\"\nstatic u32 sFeebasRngValue;", - "sourceUrl": "https://github.com/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/wild_encounter.c#L170-L174" + "sourceUrl": "https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/wild_encounter.c#L170-L174" }, { "sym": "CalculatePPWithBonus", @@ -418,7 +407,7 @@ "funcC": "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}", "prependC": "#include \"pokemon.h\"", "m2cCtx": true, - "sourceUrl": "https://github.com/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/pokemon.c#L4636-L4640" + "sourceUrl": "https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/pokemon.c#L4636-L4640" }, { "sym": "GiveBerryPowder", @@ -430,17 +419,8 @@ ], "funcC": "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}", "prependC": "#define MAX_BERRY_POWDER 99999\nu32 DecryptBerryPowder(u32 *powder);\nvoid SetBerryPowder(u32 *powder, u32 amount);", - "proto": { - "DecryptBerryPowder": { - "params": 1 - }, - "SetBerryPowder": { - "returnsVoid": true, - "params": 2 - } - }, "m2cCtx": true, - "sourceUrl": "https://github.com/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/berry_powder.c#L162-L176" + "sourceUrl": "https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/berry_powder.c#L162-L176" } ] } diff --git a/apps/benchmark/dataset/real/sa3.json b/apps/benchmark/dataset/real/sa3.json index da54574d..4b0e732a 100644 --- a/apps/benchmark/dataset/real/sa3.json +++ b/apps/benchmark/dataset/real/sa3.json @@ -2,6 +2,9 @@ "project": "sa3", "toolchain": "agbcc", "repoDir": "sa3", + "repo": "macabeus/sa3", + "branch": "asmlift-benchmark", + "elfMake": "asmlift-elf", "cppIncludes": [ "-iquote", "include", @@ -30,7 +33,7 @@ "abs" ], "funcC": "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/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L433-L447" + "sourceUrl": "https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L433-L447" }, { "sym": "SeedRng", @@ -45,7 +48,7 @@ "returnsVoid": true } }, - "sourceUrl": "https://github.com/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L427-L431" + "sourceUrl": "https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L427-L431" }, { "sym": "Random", @@ -57,7 +60,7 @@ "prependC": "u32 gRngPrevValue;\nu32 gRngValue;\n#define RAND_CONST 0x37119371", "funcC": "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}", "m2cCtx": true, - "sourceUrl": "https://github.com/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L402-L425" + "sourceUrl": "https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L402-L425" }, { "sym": "sa2__sub_808558C", @@ -68,7 +71,7 @@ "shift" ], "funcC": "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/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L469-L482" + "sourceUrl": "https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L469-L482" }, { "sym": "sa2__sub_8085654", @@ -79,7 +82,7 @@ "shift" ], "funcC": "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/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L509-L517" + "sourceUrl": "https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L509-L517" }, { "sym": "sa2__sub_80855C0", @@ -89,7 +92,7 @@ "shift" ], "funcC": "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/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L484-L489" + "sourceUrl": "https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L484-L489" }, { "sym": "sa2__sub_80856DC", @@ -98,7 +101,7 @@ "soft-div" ], "funcC": "s32 SA2_LABEL(sub_80856DC)(s32 a, s32 b, s32 c) { return (a * 7 + b * 6 - c) / 12; }", - "sourceUrl": "https://github.com/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L529-L529" + "sourceUrl": "https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L529-L529" }, { "sym": "sa2__sub_8085714", @@ -107,7 +110,7 @@ "shift" ], "funcC": "s32 SA2_LABEL(sub_8085714)(s32 a, s32 b, s32 c) { return ((a + b * 8) - c) >> 3; }", - "sourceUrl": "https://github.com/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L533-L533" + "sourceUrl": "https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L533-L533" }, { "sym": "sa2__sub_8085758", @@ -115,7 +118,7 @@ "arithmetic" ], "funcC": "s32 SA2_LABEL(sub_8085758)(s32 a, s32 b) { return b - a; }", - "sourceUrl": "https://github.com/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L539-L539" + "sourceUrl": "https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L539-L539" }, { "sym": "EwramInitHeap", @@ -132,7 +135,7 @@ } }, "m2cCtx": true, - "sourceUrl": "https://github.com/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/malloc_ewram.c#L7-L12" + "sourceUrl": "https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/malloc_ewram.c#L7-L12" }, { "sym": "EwramMalloc", @@ -145,7 +148,7 @@ ], "funcC": "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}", "m2cCtx": true, - "sourceUrl": "https://github.com/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/malloc_ewram.c#L14-L61" + "sourceUrl": "https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/malloc_ewram.c#L14-L61" }, { "sym": "EwramFree", @@ -163,7 +166,7 @@ } }, "m2cCtx": true, - "sourceUrl": "https://github.com/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/malloc_ewram.c#L63-L97" + "sourceUrl": "https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/malloc_ewram.c#L63-L97" }, { "sym": "numToASCII", @@ -180,7 +183,7 @@ "returnsVoid": true } }, - "sourceUrl": "https://github.com/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/sprite.c#L127-L141" + "sourceUrl": "https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/sprite.c#L127-L141" }, { "sym": "Base10DigitsToHexNibbles", @@ -191,8 +194,8 @@ "shift" ], "funcC": "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", - "note": "Div() resolves to an inline macro (int division) \u2014 soft-div idiom.", - "sourceUrl": "https://github.com/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/sprite.c#L147-L164" + "note": "Div() resolves to an inline macro (int division) — soft-div idiom.", + "sourceUrl": "https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/sprite.c#L147-L164" }, { "sym": "VerifyFlashSector_Core", @@ -203,7 +206,7 @@ "branch" ], "funcC": "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/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/lib/agb_flash/agb_flash.c#L286-L294" + "sourceUrl": "https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/lib/agb_flash/agb_flash.c#L286-L294" }, { "sym": "sa2__sub_8004418", @@ -216,13 +219,8 @@ ], "prependC": "#include \nstatic const u8 unkFractions[8] = { I(Q(0.5 * 2)), I(Q(0.0 * 2)), I(Q(1.0 * 2)), I(Q(1.5 * 2)), I(Q(3.0 * 2)), I(Q(3.5 * 2)), I(Q(2.5 * 2)), I(Q(2.0 * 2)) };", "funcC": "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}", - "proto": { - "memcpy": { - "params": 3 - } - }, "m2cCtx": true, - "sourceUrl": "https://github.com/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/sprite.c#L73-L125" + "sourceUrl": "https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/sprite.c#L73-L125" }, { "sym": "GetSaveSectorChecksum", @@ -235,7 +233,7 @@ ], "prependC": "#include \"game/save.h\"", "funcC": "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/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/code_0_0.c#L1036-L1050" + "sourceUrl": "https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/code_0_0.c#L1036-L1050" }, { "sym": "VramMalloc", @@ -250,7 +248,7 @@ "prependC": "#include \"core.h\"\n#include \"malloc_vram.h\"", "funcC": "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}", "m2cCtx": true, - "sourceUrl": "https://github.com/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/malloc_vram.c#L5-L31" + "sourceUrl": "https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/malloc_vram.c#L5-L31" }, { "sym": "VramGetTotalAllocatedTiles", @@ -263,7 +261,7 @@ "prependC": "#include \"core.h\"\n#include \"malloc_vram.h\"", "funcC": "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", "m2cCtx": true, - "sourceUrl": "https://github.com/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/malloc_vram.c#L46-L58" + "sourceUrl": "https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/malloc_vram.c#L46-L58" }, { "sym": "GetInput", @@ -280,17 +278,10 @@ "proto": { "GetInput": { "returnsVoid": true - }, - "InputRecorderRead": { - "params": 0 - }, - "InputRecorderWrite": { - "params": 1, - "returnsVoid": true } }, "m2cCtx": true, - "sourceUrl": "https://github.com/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/core.c#L971-L1020" + "sourceUrl": "https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/core.c#L971-L1020" }, { "sym": "sa2__sub_8007858", @@ -308,7 +299,7 @@ "returnsVoid": true } }, - "sourceUrl": "https://github.com/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/bg_triangles.c#L826-L848" + "sourceUrl": "https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/bg_triangles.c#L826-L848" }, { "sym": "sa2__sub_8007958", @@ -326,7 +317,7 @@ "returnsVoid": true } }, - "sourceUrl": "https://github.com/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/bg_triangles.c#L866-L888" + "sourceUrl": "https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/bg_triangles.c#L866-L888" }, { "sym": "sa2__sub_80856F8", @@ -335,7 +326,7 @@ "soft-div" ], "funcC": "s32 SA2_LABEL(sub_80856F8)(s32 a, s32 b, s32 c) { return ((b * 6 - a) + c * 7) / 12; }", - "sourceUrl": "https://github.com/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L531-L531" + "sourceUrl": "https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L531-L531" }, { "sym": "sa2__sub_8085720", @@ -344,7 +335,7 @@ "shift" ], "funcC": "s32 SA2_LABEL(sub_8085720)(s32 a, s32 b, s32 c) { return ((b * 8 - a) + c) >> 3; }", - "sourceUrl": "https://github.com/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L535-L535" + "sourceUrl": "https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L535-L535" }, { "sym": "sa2__sub_8085798", @@ -353,7 +344,7 @@ "shift" ], "funcC": "s32 SA2_LABEL(sub_8085798)(s32 a, s32 b, s32 c) { return ((c - a) + ((c - a) >> 1)) - (b >> 1); }", - "sourceUrl": "https://github.com/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L549-L549" + "sourceUrl": "https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L549-L549" }, { "sym": "sa2__sub_808595C", @@ -362,7 +353,7 @@ "shift" ], "funcC": "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/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L580-L587" + "sourceUrl": "https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L580-L587" }, { "sym": "sa2__sub_80838CC", @@ -379,7 +370,7 @@ } }, "funcC": "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/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L177-L183" + "sourceUrl": "https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L177-L183" }, { "sym": "sa2__sub_808399C", @@ -396,7 +387,7 @@ } }, "funcC": "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/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L185-L194" + "sourceUrl": "https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L185-L194" }, { "sym": "OamMalloc", @@ -410,7 +401,7 @@ "prependC": "#include \"core.h\"\n#include \"sprite.h\"", "funcC": "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}", "m2cCtx": true, - "sourceUrl": "https://github.com/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/sprite.c#L931-L957" + "sourceUrl": "https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/sprite.c#L931-L957" }, { "sym": "sa2__sub_8083504", @@ -429,7 +420,7 @@ }, "funcC": "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}", "m2cCtx": true, - "sourceUrl": "https://github.com/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L67-L92" + "sourceUrl": "https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L67-L92" }, { "sym": "ProcessOamBuffers", @@ -442,7 +433,7 @@ ], "prependC": "#include \"core.h\"\n#include \"flags.h\"\n#include \"sprite.h\"", "funcC": "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/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/sprite.c#L959-L1029", + "sourceUrl": "https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/sprite.c#L959-L1029", "m2cCtx": true }, { @@ -455,7 +446,7 @@ ], "prependC": "#include \"core.h\"\n#include \"flags.h\"", "funcC": "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/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/bg_triangles.c#L850-L864" + "sourceUrl": "https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/bg_triangles.c#L850-L864" } ] -} \ No newline at end of file +} diff --git a/apps/benchmark/dataset/real/snowboardkids2.json b/apps/benchmark/dataset/real/snowboardkids2.json index 9558ae58..05e4d352 100644 --- a/apps/benchmark/dataset/real/snowboardkids2.json +++ b/apps/benchmark/dataset/real/snowboardkids2.json @@ -2,6 +2,9 @@ "project": "snowboardkids2", "toolchain": "gcc2.7.2kmc", "repoDir": "snowboardkids2-decomp", + "repo": "macabeus/snowboardkids2-decomp", + "branch": "asmlift-benchmark", + "elfMake": "asmlift-elf", "cppIncludes": [ "-nostdinc", "-Iinclude", @@ -35,7 +38,7 @@ "note": "src/1DCF60.c: reads a count field via base-relative offset; pure leaf", "prependC": "typedef struct {\n s32 entriesOffset;\n s32 countOffset;\n} TableHeader;", "funcC": "s32 func_800B0DC0_1DCF60(TableHeader *table) {\n return *(s32 *)(table->countOffset + (s32)table);\n}", - "sourceUrl": "https://github.com/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/1DCF60.c#L14-L16" + "sourceUrl": "https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/1DCF60.c#L14-L16" }, { "sym": "getTableEntryByU16Index", @@ -53,7 +56,7 @@ "returnsVoid": true } }, - "sourceUrl": "https://github.com/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/19E80.c#L3-L17" + "sourceUrl": "https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/19E80.c#L3-L17" }, { "sym": "func_80038000_38C00", @@ -66,7 +69,7 @@ "note": "src/38BE0.c: settings getter with if-chain over a global struct; leaf", "prependC": "#include \"EepromSaveData_type.h\"", "funcC": "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/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/38BE0.c#L8-L20" + "sourceUrl": "https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/38BE0.c#L8-L20" }, { "sym": "func_80037FE0_38BE0", @@ -78,7 +81,7 @@ "note": "src/38BE0.c: save-slot-in-use predicate; leaf", "prependC": "#include \"EepromSaveData_type.h\"", "funcC": "s32 func_80037FE0_38BE0(u8 arg0) {\n return EepromSaveData->save_slot_status[arg0] == 1;\n}", - "sourceUrl": "https://github.com/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/38BE0.c#L4-L6" + "sourceUrl": "https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/38BE0.c#L4-L6" }, { "sym": "func_80018DC0_199C0", @@ -97,7 +100,7 @@ } }, "m2cCtx": true, - "sourceUrl": "https://github.com/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/199C0.c#L16-L29" + "sourceUrl": "https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/199C0.c#L16-L29" }, { "sym": "func_80021C00_22800", @@ -115,7 +118,7 @@ } }, "m2cCtx": true, - "sourceUrl": "https://github.com/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/227D0.c#L18-L26" + "sourceUrl": "https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/227D0.c#L18-L26" }, { "sym": "func_80021D88_22988", @@ -133,7 +136,7 @@ } }, "m2cCtx": true, - "sourceUrl": "https://github.com/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/22920.c#L35-L46" + "sourceUrl": "https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/22920.c#L35-L46" }, { "sym": "initSteppedMatrixController", @@ -152,7 +155,7 @@ } }, "m2cCtx": true, - "sourceUrl": "https://github.com/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/76B0.c#L30-L36" + "sourceUrl": "https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/76B0.c#L30-L36" }, { "sym": "GenericTriggerInit", @@ -171,7 +174,7 @@ } }, "m2cCtx": true, - "sourceUrl": "https://github.com/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/198B0.c#L10-L18" + "sourceUrl": "https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/198B0.c#L10-L18" }, { "sym": "func_80035F80_36B80", @@ -185,7 +188,7 @@ "prependC": "extern u32 *_3F6950_ROM_START;\nextern u32 *_3F6950_ROM_END;\nextern u32 *_459E00_ROM_START;\nextern u32 *_459E00_ROM_END;\nvoid *loadCompressedData(void *, void *, s32);", "funcC": "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}", "m2cCtx": true, - "sourceUrl": "https://github.com/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/36B80.c#L8-L14" + "sourceUrl": "https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/36B80.c#L8-L14" }, { "sym": "func_80014440_15040", @@ -202,7 +205,7 @@ "returnsVoid": true } }, - "sourceUrl": "https://github.com/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/10AD0.c#L32-L39" + "sourceUrl": "https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/10AD0.c#L32-L39" }, { "sym": "func_8002ADB4_2B9B4", @@ -214,7 +217,7 @@ ], "note": "src/2AF90.c: angle interpolation with wrap handling; pure leaf, uses ABS macro", "funcC": "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/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/2AF90.c#L103-L162" + "sourceUrl": "https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/2AF90.c#L103-L162" }, { "sym": "func_8002B4B8_2C0B8", @@ -225,7 +228,7 @@ ], "note": "src/2AF90.c: signed angle difference in 13-bit angle space; pure leaf", "funcC": "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/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/2AF90.c#L168-L180" + "sourceUrl": "https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/2AF90.c#L168-L180" }, { "sym": "func_8001BD74_1C974", @@ -241,7 +244,7 @@ "returnsVoid": true } }, - "sourceUrl": "https://github.com/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/1BBA0.c#L108-L117" + "sourceUrl": "https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/1BBA0.c#L108-L117" }, { "sym": "func_8001BCDC_1C8DC", @@ -260,7 +263,7 @@ "returnsVoid": true } }, - "sourceUrl": "https://github.com/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/1BBA0.c#L87-L106" + "sourceUrl": "https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/1BBA0.c#L87-L106" }, { "sym": "func_8002BE94_2CA94", @@ -278,7 +281,7 @@ "returnsVoid": true } }, - "sourceUrl": "https://github.com/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/2C8F0.c#L47-L53" + "sourceUrl": "https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/2C8F0.c#L47-L53" }, { "sym": "loadAssetGroupResources", @@ -298,7 +301,7 @@ } }, "m2cCtx": true, - "sourceUrl": "https://github.com/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/3B80.c#L80-L101" + "sourceUrl": "https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/3B80.c#L80-L101" }, { "sym": "func_800167B0_173B0", @@ -317,7 +320,7 @@ } }, "m2cCtx": true, - "sourceUrl": "https://github.com/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/16FA0.c#L132-L147" + "sourceUrl": "https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/16FA0.c#L132-L147" }, { "sym": "func_8002ACFC_2B8FC", @@ -330,7 +333,7 @@ "note": "src/2AF90.c: proximity/heading test against the player position; fixed-point distance check", "prependC": "#include \"gamestate.h\"\n#include \"geometry.h\"\n#include \"task_scheduler.h\"", "funcC": "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/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/2AF90.c#L88-L101" + "sourceUrl": "https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/2AF90.c#L88-L101" }, { "sym": "func_8002A390_2AF90", @@ -344,7 +347,7 @@ "note": "src/2AF90.c: state-machine step with fall-through switch cases over a mode byte", "prependC": "#include \"gamestate.h\"\n#include \"geometry.h\"\n#include \"task_scheduler.h\"\n\ntypedef struct {\n void *model;\n Transform3D matrix;\n u8 pad24[0xA];\n s16 unk2E;\n u8 pad30[0x7];\n u8 unk37;\n u8 pad38[0x14];\n u16 *unk4C;\n u16 unk50;\n u8 pad52[0x2];\n u16 unk54;\n u8 pad56[0x6];\n u8 unk5C;\n u8 unk5D;\n u8 unk5E;\n u8 pad5F[0x2];\n u8 unk61;\n} Func8002A390Arg;\n\nextern s32 func_8002A4AC_2B0AC(void *, u8);\nextern s32 func_8002A7CC_2B3CC(void *);\ns32 func_8002ACFC_2B8FC(s32, s32, s16);", "funcC": "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/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/2AF90.c#L34-L82" + "sourceUrl": "https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/2AF90.c#L34-L82" }, { "sym": "func_800154A8_160A8", @@ -354,7 +357,7 @@ "call" ], "funcC": "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/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/15690.c#L304-L318" + "sourceUrl": "https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/15690.c#L304-L318" }, { "sym": "func_800B4B30_1E1BE0", @@ -364,7 +367,7 @@ ], "prependC": "#include \"1DFAA0.h\"\n#include \"20F0.h\"\n#include \"3E160.h\"\n#include \"common.h\"\n#include \"displaylist.h\"\n#include \"geometry.h\"\n#include \"graphics.h\"\n#include \"overlay.h\"\n#include \"task_scheduler.h\"", "funcC": "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/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/1E1BA0.c#L40-L50", + "sourceUrl": "https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/1E1BA0.c#L40-L50", "m2cCtx": true }, { @@ -374,7 +377,7 @@ ], "prependC": "#include \"1E2BE0.h\"", "funcC": "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/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/1E2BE0.c#L21-L53" + "sourceUrl": "https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/1E2BE0.c#L21-L53" }, { "sym": "func_800B68F4_1E39A4", @@ -383,7 +386,7 @@ ], "prependC": "#include \"1E36C0.h\"", "funcC": "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/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/1E36C0.c#L134-L141" + "sourceUrl": "https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/1E36C0.c#L134-L141" }, { "sym": "func_800B93F0_1E64A0", @@ -393,7 +396,7 @@ ], "prependC": "#include \"1E64A0.h\"", "funcC": "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/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/1E64A0.c#L16-L30" + "sourceUrl": "https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/1E64A0.c#L16-L30" }, { "sym": "func_80028BB0_297B0", @@ -404,7 +407,7 @@ ], "prependC": "#include \"297B0.h\"\n#include \"20F0.h\"\n#include \"3E160.h\"\n#include \"B040.h\"\n#include \"common.h\"\n#include \"geometry.h\"\n#include \"graphics.h\"\n#include \"rand.h\"\n#include \"task_scheduler.h\"", "funcC": "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/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/297B0.c#L42-L50", + "sourceUrl": "https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/297B0.c#L42-L50", "m2cCtx": true }, { @@ -416,7 +419,7 @@ ], "prependC": "#include \"297B0.h\"\n#include \"20F0.h\"\n#include \"3E160.h\"\n#include \"B040.h\"\n#include \"common.h\"\n#include \"geometry.h\"\n#include \"graphics.h\"\n#include \"rand.h\"\n#include \"task_scheduler.h\"", "funcC": "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/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/297B0.c#L123-L131", + "sourceUrl": "https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/297B0.c#L123-L131", "m2cCtx": true }, { @@ -429,7 +432,7 @@ ], "prependC": "#include \"1E36C0.h\"", "funcC": "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/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/1E36C0.c#L576-L606" + "sourceUrl": "https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/1E36C0.c#L576-L606" }, { "sym": "func_800B7760_1E4810", @@ -440,7 +443,7 @@ ], "prependC": "#include \"1E36C0.h\"", "funcC": "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/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/1E36C0.c#L608-L622" + "sourceUrl": "https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/1E36C0.c#L608-L622" }, { "sym": "func_800B9C20_1E6CD0", @@ -450,7 +453,7 @@ ], "prependC": "#include \"1E64A0.h\"", "funcC": "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/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/1E64A0.c#L201-L205" + "sourceUrl": "https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/1E64A0.c#L201-L205" }, { "sym": "func_8002A2D0_2AED0", @@ -462,7 +465,7 @@ ], "prependC": "#include \"297B0.h\"\n#include \"20F0.h\"\n#include \"3E160.h\"\n#include \"B040.h\"\n#include \"common.h\"\n#include \"geometry.h\"\n#include \"graphics.h\"\n#include \"rand.h\"\n#include \"task_scheduler.h\"", "funcC": "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/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/297B0.c#L862-L893", + "sourceUrl": "https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/297B0.c#L862-L893", "m2cCtx": true }, { @@ -474,7 +477,7 @@ ], "prependC": "#include \"52880.h\"", "funcC": "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/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/52880.c#L137-L158" + "sourceUrl": "https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/52880.c#L137-L158" } ] -} \ No newline at end of file +} diff --git a/apps/benchmark/dataset/real/tu/af/PROVENANCE.json b/apps/benchmark/dataset/real/tu/af/PROVENANCE.json index 80fdfded..bc94d12f 100644 --- a/apps/benchmark/dataset/real/tu/af/PROVENANCE.json +++ b/apps/benchmark/dataset/real/tu/af/PROVENANCE.json @@ -1,7 +1,7 @@ { "project": "af", - "commit": "ff5f68aacc7aab10d5b281277447f1b805c0a5a2", - "dirty": true, + "commit": "4515c15b5848b1ec85e78cb3776e12990cafe004", + "dirty": false, "cpp": "cpp-14 (Homebrew GCC 14.2.0_1) 14.2.0", - "generatedAt": "2026-07-20T20:29:39.677Z" + "generatedAt": "2026-08-01T15:04:28.072Z" } diff --git a/apps/benchmark/dataset/real/tu/af/symbols.json.gz b/apps/benchmark/dataset/real/tu/af/symbols.json.gz new file mode 100644 index 00000000..4c65a4ae Binary files /dev/null and b/apps/benchmark/dataset/real/tu/af/symbols.json.gz differ diff --git a/apps/benchmark/dataset/real/tu/kleod/CheckTileCollisionVertical.i.gz b/apps/benchmark/dataset/real/tu/kleod/CheckTileCollisionVertical.i.gz index ccaf928d..e62f81f7 100644 Binary files a/apps/benchmark/dataset/real/tu/kleod/CheckTileCollisionVertical.i.gz and b/apps/benchmark/dataset/real/tu/kleod/CheckTileCollisionVertical.i.gz differ diff --git a/apps/benchmark/dataset/real/tu/kleod/CheckWorldCompletion.i.gz b/apps/benchmark/dataset/real/tu/kleod/CheckWorldCompletion.i.gz index e5d39642..382cba54 100644 Binary files a/apps/benchmark/dataset/real/tu/kleod/CheckWorldCompletion.i.gz and b/apps/benchmark/dataset/real/tu/kleod/CheckWorldCompletion.i.gz differ diff --git a/apps/benchmark/dataset/real/tu/kleod/CopyBGScrollTiles.i.gz b/apps/benchmark/dataset/real/tu/kleod/CopyBGScrollTiles.i.gz index 3fffe06c..c159e920 100644 Binary files a/apps/benchmark/dataset/real/tu/kleod/CopyBGScrollTiles.i.gz and b/apps/benchmark/dataset/real/tu/kleod/CopyBGScrollTiles.i.gz differ diff --git a/apps/benchmark/dataset/real/tu/kleod/Decompress.i.gz b/apps/benchmark/dataset/real/tu/kleod/Decompress.i.gz index c2dd2d96..c00a4005 100644 Binary files a/apps/benchmark/dataset/real/tu/kleod/Decompress.i.gz and b/apps/benchmark/dataset/real/tu/kleod/Decompress.i.gz differ diff --git a/apps/benchmark/dataset/real/tu/kleod/DecompressAlloc.i.gz b/apps/benchmark/dataset/real/tu/kleod/DecompressAlloc.i.gz index a7dbee51..a0116761 100644 Binary files a/apps/benchmark/dataset/real/tu/kleod/DecompressAlloc.i.gz and b/apps/benchmark/dataset/real/tu/kleod/DecompressAlloc.i.gz differ diff --git a/apps/benchmark/dataset/real/tu/kleod/DecompressDma.i.gz b/apps/benchmark/dataset/real/tu/kleod/DecompressDma.i.gz index e32be18a..06e2a8e0 100644 Binary files a/apps/benchmark/dataset/real/tu/kleod/DecompressDma.i.gz and b/apps/benchmark/dataset/real/tu/kleod/DecompressDma.i.gz differ diff --git a/apps/benchmark/dataset/real/tu/kleod/DivideQ4.i.gz b/apps/benchmark/dataset/real/tu/kleod/DivideQ4.i.gz index beda89c5..293c920f 100644 Binary files a/apps/benchmark/dataset/real/tu/kleod/DivideQ4.i.gz and b/apps/benchmark/dataset/real/tu/kleod/DivideQ4.i.gz differ diff --git a/apps/benchmark/dataset/real/tu/kleod/DivideQ8.i.gz b/apps/benchmark/dataset/real/tu/kleod/DivideQ8.i.gz index 12cdd154..237d3efc 100644 Binary files a/apps/benchmark/dataset/real/tu/kleod/DivideQ8.i.gz and b/apps/benchmark/dataset/real/tu/kleod/DivideQ8.i.gz differ diff --git a/apps/benchmark/dataset/real/tu/kleod/DmaSpriteToObjVram.i.gz b/apps/benchmark/dataset/real/tu/kleod/DmaSpriteToObjVram.i.gz index 27932b01..da5d916d 100644 Binary files a/apps/benchmark/dataset/real/tu/kleod/DmaSpriteToObjVram.i.gz and b/apps/benchmark/dataset/real/tu/kleod/DmaSpriteToObjVram.i.gz differ diff --git a/apps/benchmark/dataset/real/tu/kleod/FreeAllDecompBuffers.i.gz b/apps/benchmark/dataset/real/tu/kleod/FreeAllDecompBuffers.i.gz index 3817a9ad..90b81c7b 100644 Binary files a/apps/benchmark/dataset/real/tu/kleod/FreeAllDecompBuffers.i.gz and b/apps/benchmark/dataset/real/tu/kleod/FreeAllDecompBuffers.i.gz differ diff --git a/apps/benchmark/dataset/real/tu/kleod/GameUpdate.i.gz b/apps/benchmark/dataset/real/tu/kleod/GameUpdate.i.gz index 5f315ae7..85ed63aa 100644 Binary files a/apps/benchmark/dataset/real/tu/kleod/GameUpdate.i.gz and b/apps/benchmark/dataset/real/tu/kleod/GameUpdate.i.gz differ diff --git a/apps/benchmark/dataset/real/tu/kleod/GetEntityLookupData.i.gz b/apps/benchmark/dataset/real/tu/kleod/GetEntityLookupData.i.gz index d978d06d..6fb87d4c 100644 Binary files a/apps/benchmark/dataset/real/tu/kleod/GetEntityLookupData.i.gz and b/apps/benchmark/dataset/real/tu/kleod/GetEntityLookupData.i.gz differ diff --git a/apps/benchmark/dataset/real/tu/kleod/MultiplyQ4.i.gz b/apps/benchmark/dataset/real/tu/kleod/MultiplyQ4.i.gz index c0f3db20..52949676 100644 Binary files a/apps/benchmark/dataset/real/tu/kleod/MultiplyQ4.i.gz and b/apps/benchmark/dataset/real/tu/kleod/MultiplyQ4.i.gz differ diff --git a/apps/benchmark/dataset/real/tu/kleod/MultiplyQ8.i.gz b/apps/benchmark/dataset/real/tu/kleod/MultiplyQ8.i.gz index 565abaf0..ae08ac4f 100644 Binary files a/apps/benchmark/dataset/real/tu/kleod/MultiplyQ8.i.gz and b/apps/benchmark/dataset/real/tu/kleod/MultiplyQ8.i.gz differ diff --git a/apps/benchmark/dataset/real/tu/kleod/PROVENANCE.json b/apps/benchmark/dataset/real/tu/kleod/PROVENANCE.json index 85f868bf..5c0f9260 100644 --- a/apps/benchmark/dataset/real/tu/kleod/PROVENANCE.json +++ b/apps/benchmark/dataset/real/tu/kleod/PROVENANCE.json @@ -1,7 +1,7 @@ { "project": "kleod", - "commit": "ebe9bd0eccaa3a763a96321af92e17fdede003c4", - "dirty": true, + "commit": "704fd74330959112873665d790f911e3679770c0", + "dirty": false, "cpp": "cpp-14 (Homebrew GCC 14.2.0_1) 14.2.0", - "generatedAt": "2026-07-20T19:20:39.468Z" + "generatedAt": "2026-08-02T12:01:59.124Z" } diff --git a/apps/benchmark/dataset/real/tu/kleod/ProcessHBlankWait.i.gz b/apps/benchmark/dataset/real/tu/kleod/ProcessHBlankWait.i.gz index 2b1e9895..601d3c28 100644 Binary files a/apps/benchmark/dataset/real/tu/kleod/ProcessHBlankWait.i.gz and b/apps/benchmark/dataset/real/tu/kleod/ProcessHBlankWait.i.gz differ diff --git a/apps/benchmark/dataset/real/tu/kleod/ReadKeyInput.i.gz b/apps/benchmark/dataset/real/tu/kleod/ReadKeyInput.i.gz index e4459d97..403c97b7 100644 Binary files a/apps/benchmark/dataset/real/tu/kleod/ReadKeyInput.i.gz and b/apps/benchmark/dataset/real/tu/kleod/ReadKeyInput.i.gz differ diff --git a/apps/benchmark/dataset/real/tu/kleod/ReadUnalignedU16.i.gz b/apps/benchmark/dataset/real/tu/kleod/ReadUnalignedU16.i.gz index c44e6270..bdbc1b7f 100644 Binary files a/apps/benchmark/dataset/real/tu/kleod/ReadUnalignedU16.i.gz and b/apps/benchmark/dataset/real/tu/kleod/ReadUnalignedU16.i.gz differ diff --git a/apps/benchmark/dataset/real/tu/kleod/ReadUnalignedU32.i.gz b/apps/benchmark/dataset/real/tu/kleod/ReadUnalignedU32.i.gz index a75224ba..ffb461a0 100644 Binary files a/apps/benchmark/dataset/real/tu/kleod/ReadUnalignedU32.i.gz and b/apps/benchmark/dataset/real/tu/kleod/ReadUnalignedU32.i.gz differ diff --git a/apps/benchmark/dataset/real/tu/kleod/ReciprocalQ4.i.gz b/apps/benchmark/dataset/real/tu/kleod/ReciprocalQ4.i.gz index 318f59e1..e671f961 100644 Binary files a/apps/benchmark/dataset/real/tu/kleod/ReciprocalQ4.i.gz and b/apps/benchmark/dataset/real/tu/kleod/ReciprocalQ4.i.gz differ diff --git a/apps/benchmark/dataset/real/tu/kleod/ReciprocalQ8.i.gz b/apps/benchmark/dataset/real/tu/kleod/ReciprocalQ8.i.gz index 91c904fa..f7a41f0a 100644 Binary files a/apps/benchmark/dataset/real/tu/kleod/ReciprocalQ8.i.gz and b/apps/benchmark/dataset/real/tu/kleod/ReciprocalQ8.i.gz differ diff --git a/apps/benchmark/dataset/real/tu/kleod/ReturnOne.i.gz b/apps/benchmark/dataset/real/tu/kleod/ReturnOne.i.gz index 402e4295..af3426c4 100644 Binary files a/apps/benchmark/dataset/real/tu/kleod/ReturnOne.i.gz and b/apps/benchmark/dataset/real/tu/kleod/ReturnOne.i.gz differ diff --git a/apps/benchmark/dataset/real/tu/kleod/RollRandomLevelVariant.i.gz b/apps/benchmark/dataset/real/tu/kleod/RollRandomLevelVariant.i.gz index 2234964b..d7e1410b 100644 Binary files a/apps/benchmark/dataset/real/tu/kleod/RollRandomLevelVariant.i.gz and b/apps/benchmark/dataset/real/tu/kleod/RollRandomLevelVariant.i.gz differ diff --git a/apps/benchmark/dataset/real/tu/kleod/StrCpy.i.gz b/apps/benchmark/dataset/real/tu/kleod/StrCpy.i.gz index 10a41944..a5e3e361 100644 Binary files a/apps/benchmark/dataset/real/tu/kleod/StrCpy.i.gz and b/apps/benchmark/dataset/real/tu/kleod/StrCpy.i.gz differ diff --git a/apps/benchmark/dataset/real/tu/kleod/StreamCmd_SetBGScroll.i.gz b/apps/benchmark/dataset/real/tu/kleod/StreamCmd_SetBGScroll.i.gz index d9315181..621bad79 100644 Binary files a/apps/benchmark/dataset/real/tu/kleod/StreamCmd_SetBGScroll.i.gz and b/apps/benchmark/dataset/real/tu/kleod/StreamCmd_SetBGScroll.i.gz differ diff --git a/apps/benchmark/dataset/real/tu/kleod/StreamCmd_SetWindowRegs.i.gz b/apps/benchmark/dataset/real/tu/kleod/StreamCmd_SetWindowRegs.i.gz index 6eca8b2e..7af0077b 100644 Binary files a/apps/benchmark/dataset/real/tu/kleod/StreamCmd_SetWindowRegs.i.gz and b/apps/benchmark/dataset/real/tu/kleod/StreamCmd_SetWindowRegs.i.gz differ diff --git a/apps/benchmark/dataset/real/tu/kleod/TransformSingleEntityToScreen.i.gz b/apps/benchmark/dataset/real/tu/kleod/TransformSingleEntityToScreen.i.gz index b6a30c72..69a86316 100644 Binary files a/apps/benchmark/dataset/real/tu/kleod/TransformSingleEntityToScreen.i.gz and b/apps/benchmark/dataset/real/tu/kleod/TransformSingleEntityToScreen.i.gz differ diff --git a/apps/benchmark/dataset/real/tu/kleod/UpdateEntities.i.gz b/apps/benchmark/dataset/real/tu/kleod/UpdateEntities.i.gz index 1b4dbe1c..22270830 100644 Binary files a/apps/benchmark/dataset/real/tu/kleod/UpdateEntities.i.gz and b/apps/benchmark/dataset/real/tu/kleod/UpdateEntities.i.gz differ diff --git a/apps/benchmark/dataset/real/tu/kleod/UpdateFadeEffect.i.gz b/apps/benchmark/dataset/real/tu/kleod/UpdateFadeEffect.i.gz index 4f218779..7bbc6d78 100644 Binary files a/apps/benchmark/dataset/real/tu/kleod/UpdateFadeEffect.i.gz and b/apps/benchmark/dataset/real/tu/kleod/UpdateFadeEffect.i.gz differ diff --git a/apps/benchmark/dataset/real/tu/kleod/UpdateHUDCounterDisplay.i.gz b/apps/benchmark/dataset/real/tu/kleod/UpdateHUDCounterDisplay.i.gz index 436cae34..868fa313 100644 Binary files a/apps/benchmark/dataset/real/tu/kleod/UpdateHUDCounterDisplay.i.gz and b/apps/benchmark/dataset/real/tu/kleod/UpdateHUDCounterDisplay.i.gz differ diff --git a/apps/benchmark/dataset/real/tu/kleod/UpdateWorldMapNodeTile.i.gz b/apps/benchmark/dataset/real/tu/kleod/UpdateWorldMapNodeTile.i.gz index b5a84b7c..89b657e9 100644 Binary files a/apps/benchmark/dataset/real/tu/kleod/UpdateWorldMapNodeTile.i.gz and b/apps/benchmark/dataset/real/tu/kleod/UpdateWorldMapNodeTile.i.gz differ diff --git a/apps/benchmark/dataset/real/tu/kleod/VBlankHandlerMinimal.i.gz b/apps/benchmark/dataset/real/tu/kleod/VBlankHandlerMinimal.i.gz index 2d31981e..523b5a90 100644 Binary files a/apps/benchmark/dataset/real/tu/kleod/VBlankHandlerMinimal.i.gz and b/apps/benchmark/dataset/real/tu/kleod/VBlankHandlerMinimal.i.gz differ diff --git a/apps/benchmark/dataset/real/tu/kleod/WritePaletteColor.i.gz b/apps/benchmark/dataset/real/tu/kleod/WritePaletteColor.i.gz index 1841468a..2f7edb92 100644 Binary files a/apps/benchmark/dataset/real/tu/kleod/WritePaletteColor.i.gz and b/apps/benchmark/dataset/real/tu/kleod/WritePaletteColor.i.gz differ diff --git a/apps/benchmark/dataset/real/tu/kleod/ctx-057283b93369.i.gz b/apps/benchmark/dataset/real/tu/kleod/ctx-057283b93369.i.gz new file mode 100644 index 00000000..b6f9d24a Binary files /dev/null and b/apps/benchmark/dataset/real/tu/kleod/ctx-057283b93369.i.gz differ diff --git a/apps/benchmark/dataset/real/tu/kleod/ctx-10a1ea923d7f.i.gz b/apps/benchmark/dataset/real/tu/kleod/ctx-10a1ea923d7f.i.gz new file mode 100644 index 00000000..e1420185 Binary files /dev/null and b/apps/benchmark/dataset/real/tu/kleod/ctx-10a1ea923d7f.i.gz differ diff --git a/apps/benchmark/dataset/real/tu/kleod/ctx-9ccc03ef54d1.i.gz b/apps/benchmark/dataset/real/tu/kleod/ctx-9ccc03ef54d1.i.gz new file mode 100644 index 00000000..3872cfec Binary files /dev/null and b/apps/benchmark/dataset/real/tu/kleod/ctx-9ccc03ef54d1.i.gz differ diff --git a/apps/benchmark/dataset/real/tu/kleod/ctx-b4ae03db0859.i.gz b/apps/benchmark/dataset/real/tu/kleod/ctx-b4ae03db0859.i.gz new file mode 100644 index 00000000..2b8d6e60 Binary files /dev/null and b/apps/benchmark/dataset/real/tu/kleod/ctx-b4ae03db0859.i.gz differ diff --git a/apps/benchmark/dataset/real/tu/kleod/ctx-bbb0f9d88b2b.i.gz b/apps/benchmark/dataset/real/tu/kleod/ctx-bbb0f9d88b2b.i.gz new file mode 100644 index 00000000..91232449 Binary files /dev/null and b/apps/benchmark/dataset/real/tu/kleod/ctx-bbb0f9d88b2b.i.gz differ diff --git a/apps/benchmark/dataset/real/tu/kleod/ctx-f808d4b2fde6.i.gz b/apps/benchmark/dataset/real/tu/kleod/ctx-f808d4b2fde6.i.gz new file mode 100644 index 00000000..a8dd731b Binary files /dev/null and b/apps/benchmark/dataset/real/tu/kleod/ctx-f808d4b2fde6.i.gz differ diff --git a/apps/benchmark/dataset/real/tu/kleod/index.json b/apps/benchmark/dataset/real/tu/kleod/index.json index b37142eb..d56efdba 100644 --- a/apps/benchmark/dataset/real/tu/kleod/index.json +++ b/apps/benchmark/dataset/real/tu/kleod/index.json @@ -1,130 +1,130 @@ { "ReturnOne": { "tu": "ReturnOne.i.gz", - "ctx": "ctx-f8b523f02efa.i.gz" + "ctx": "ctx-b4ae03db0859.i.gz" }, "StrCpy": { "tu": "StrCpy.i.gz", - "ctx": "ctx-f8b523f02efa.i.gz" + "ctx": "ctx-b4ae03db0859.i.gz" }, "MultiplyQ8": { "tu": "MultiplyQ8.i.gz", - "ctx": "ctx-f8b523f02efa.i.gz" + "ctx": "ctx-b4ae03db0859.i.gz" }, "MultiplyQ4": { "tu": "MultiplyQ4.i.gz", - "ctx": "ctx-f8b523f02efa.i.gz" + "ctx": "ctx-b4ae03db0859.i.gz" }, "DivideQ8": { "tu": "DivideQ8.i.gz", - "ctx": "ctx-f8b523f02efa.i.gz" + "ctx": "ctx-b4ae03db0859.i.gz" }, "ReciprocalQ8": { "tu": "ReciprocalQ8.i.gz", - "ctx": "ctx-f8b523f02efa.i.gz" + "ctx": "ctx-b4ae03db0859.i.gz" }, "DivideQ4": { "tu": "DivideQ4.i.gz", - "ctx": "ctx-f8b523f02efa.i.gz" + "ctx": "ctx-b4ae03db0859.i.gz" }, "ReciprocalQ4": { "tu": "ReciprocalQ4.i.gz", - "ctx": "ctx-f8b523f02efa.i.gz" + "ctx": "ctx-b4ae03db0859.i.gz" }, "ReadKeyInput": { "tu": "ReadKeyInput.i.gz", - "ctx": "ctx-f8b523f02efa.i.gz" + "ctx": "ctx-b4ae03db0859.i.gz" }, "VBlankHandlerMinimal": { "tu": "VBlankHandlerMinimal.i.gz", - "ctx": "ctx-f8b523f02efa.i.gz" + "ctx": "ctx-b4ae03db0859.i.gz" }, "ReadUnalignedU32": { "tu": "ReadUnalignedU32.i.gz", - "ctx": "ctx-f8b523f02efa.i.gz" + "ctx": "ctx-b4ae03db0859.i.gz" }, "GetEntityLookupData": { "tu": "GetEntityLookupData.i.gz", - "ctx": "ctx-f8b523f02efa.i.gz" + "ctx": "ctx-b4ae03db0859.i.gz" }, "UpdateEntities": { "tu": "UpdateEntities.i.gz", - "ctx": "ctx-f8b523f02efa.i.gz" + "ctx": "ctx-b4ae03db0859.i.gz" }, "GameUpdate": { "tu": "GameUpdate.i.gz", - "ctx": "ctx-f8b523f02efa.i.gz" + "ctx": "ctx-b4ae03db0859.i.gz" }, "Decompress": { "tu": "Decompress.i.gz", - "ctx": "ctx-f8b523f02efa.i.gz" + "ctx": "ctx-b4ae03db0859.i.gz" }, "DecompressDma": { "tu": "DecompressDma.i.gz", - "ctx": "ctx-f8b523f02efa.i.gz" + "ctx": "ctx-b4ae03db0859.i.gz" }, "CheckTileCollisionVertical": { "tu": "CheckTileCollisionVertical.i.gz", - "ctx": "ctx-0997669a5685.i.gz" + "ctx": "ctx-9ccc03ef54d1.i.gz" }, "ProcessHBlankWait": { "tu": "ProcessHBlankWait.i.gz", - "ctx": "ctx-f8b523f02efa.i.gz" + "ctx": "ctx-b4ae03db0859.i.gz" }, "DecompressAlloc": { "tu": "DecompressAlloc.i.gz", - "ctx": "ctx-322c201f79a5.i.gz" + "ctx": "ctx-bbb0f9d88b2b.i.gz" }, "WritePaletteColor": { "tu": "WritePaletteColor.i.gz", - "ctx": "ctx-4803b8b79691.i.gz" + "ctx": "ctx-057283b93369.i.gz" }, "ReadUnalignedU16": { "tu": "ReadUnalignedU16.i.gz", - "ctx": "ctx-f8b523f02efa.i.gz" + "ctx": "ctx-b4ae03db0859.i.gz" }, "FreeAllDecompBuffers": { "tu": "FreeAllDecompBuffers.i.gz", - "ctx": "ctx-afc6f9b0cb86.i.gz" + "ctx": "ctx-f808d4b2fde6.i.gz" }, "DmaSpriteToObjVram": { "tu": "DmaSpriteToObjVram.i.gz", - "ctx": "ctx-f8b523f02efa.i.gz" + "ctx": "ctx-b4ae03db0859.i.gz" }, "StreamCmd_SetWindowRegs": { "tu": "StreamCmd_SetWindowRegs.i.gz", - "ctx": "ctx-f8b523f02efa.i.gz" + "ctx": "ctx-b4ae03db0859.i.gz" }, "RollRandomLevelVariant": { "tu": "RollRandomLevelVariant.i.gz", - "ctx": "ctx-fb2c927dfbc4.i.gz" + "ctx": "ctx-10a1ea923d7f.i.gz" }, "TransformSingleEntityToScreen": { "tu": "TransformSingleEntityToScreen.i.gz", - "ctx": "ctx-f8b523f02efa.i.gz" + "ctx": "ctx-b4ae03db0859.i.gz" }, "CopyBGScrollTiles": { "tu": "CopyBGScrollTiles.i.gz", - "ctx": "ctx-f8b523f02efa.i.gz" + "ctx": "ctx-b4ae03db0859.i.gz" }, "UpdateHUDCounterDisplay": { "tu": "UpdateHUDCounterDisplay.i.gz", - "ctx": "ctx-f8b523f02efa.i.gz" + "ctx": "ctx-b4ae03db0859.i.gz" }, "CheckWorldCompletion": { "tu": "CheckWorldCompletion.i.gz", - "ctx": "ctx-f8b523f02efa.i.gz" + "ctx": "ctx-b4ae03db0859.i.gz" }, "UpdateWorldMapNodeTile": { "tu": "UpdateWorldMapNodeTile.i.gz", - "ctx": "ctx-f8b523f02efa.i.gz" + "ctx": "ctx-b4ae03db0859.i.gz" }, "UpdateFadeEffect": { "tu": "UpdateFadeEffect.i.gz", - "ctx": "ctx-f8b523f02efa.i.gz" + "ctx": "ctx-b4ae03db0859.i.gz" }, "StreamCmd_SetBGScroll": { "tu": "StreamCmd_SetBGScroll.i.gz", - "ctx": "ctx-f8b523f02efa.i.gz" + "ctx": "ctx-b4ae03db0859.i.gz" } } diff --git a/apps/benchmark/dataset/real/tu/kleod/symbols.json.gz b/apps/benchmark/dataset/real/tu/kleod/symbols.json.gz new file mode 100644 index 00000000..3156a5a2 Binary files /dev/null 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 5db644cf..37be1cea 100644 --- a/apps/benchmark/dataset/real/tu/marioparty3/PROVENANCE.json +++ b/apps/benchmark/dataset/real/tu/marioparty3/PROVENANCE.json @@ -1,7 +1,7 @@ { "project": "marioparty3", - "commit": "89c0fafd30375f21222c39bcefd8456bac130c53", - "dirty": true, + "commit": "6b4380b9493a2bf9a60e3be5f5b6b6e70e4b927e", + "dirty": false, "cpp": "cpp-14 (Homebrew GCC 14.2.0_1) 14.2.0", - "generatedAt": "2026-07-22T11:05:38.083Z" + "generatedAt": "2026-08-01T15:04:33.605Z" } diff --git a/apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz b/apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz new file mode 100644 index 00000000..679ea035 Binary files /dev/null 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 99ce7f29..b6e8f629 100644 --- a/apps/benchmark/dataset/real/tu/pokeemerald/PROVENANCE.json +++ b/apps/benchmark/dataset/real/tu/pokeemerald/PROVENANCE.json @@ -1,7 +1,7 @@ { "project": "pokeemerald", - "commit": "25ffb2c12c069ac6b2040f9238b2978f1de72e3f", - "dirty": true, + "commit": "9d96fe4bd358bb7f8e70dc58702d5c4cb545b761", + "dirty": false, "cpp": "cpp-14 (Homebrew GCC 14.2.0_1) 14.2.0", - "generatedAt": "2026-07-19T08:26:58.987Z" + "generatedAt": "2026-08-02T12:02:06.071Z" } diff --git a/apps/benchmark/dataset/real/tu/pokeemerald/index.json b/apps/benchmark/dataset/real/tu/pokeemerald/index.json index 51925e37..143f1fc1 100644 --- a/apps/benchmark/dataset/real/tu/pokeemerald/index.json +++ b/apps/benchmark/dataset/real/tu/pokeemerald/index.json @@ -126,9 +126,5 @@ "GiveBerryPowder": { "tu": "GiveBerryPowder.i.gz", "ctx": "ctx-264361caa05e.i.gz" - }, - "GetGameStat": { - "tu": "GetGameStat.i.gz", - "ctx": "ctx-b98da8e28d15.i.gz" } } diff --git a/apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz b/apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz new file mode 100644 index 00000000..8bae159c Binary files /dev/null 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 0983bd6f..7b4927ef 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": "b0321cdc57ef829b24d4179ed625cb3403e26633", + "commit": "a4a344bb0de8a0add5f4034a0f7b1a10c02f30e8", "dirty": false, "cpp": "cpp-14 (Homebrew GCC 14.2.0_1) 14.2.0", - "generatedAt": "2026-07-20T19:20:41.106Z" + "generatedAt": "2026-08-01T12:23:01.254Z" } diff --git a/apps/benchmark/dataset/real/tu/sa3/symbols.json.gz b/apps/benchmark/dataset/real/tu/sa3/symbols.json.gz new file mode 100644 index 00000000..fcc1f167 Binary files /dev/null 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 150fe8fd..cf42f050 100644 --- a/apps/benchmark/dataset/real/tu/snowboardkids2/PROVENANCE.json +++ b/apps/benchmark/dataset/real/tu/snowboardkids2/PROVENANCE.json @@ -1,7 +1,7 @@ { "project": "snowboardkids2", - "commit": "66e9f600be2b82dc08c87ccf0d2c6ed14509e489", - "dirty": true, + "commit": "63236cd8dce61b8a1b37765952eb340b66684476", + "dirty": false, "cpp": "cpp-14 (Homebrew GCC 14.2.0_1) 14.2.0", - "generatedAt": "2026-07-20T20:31:58.925Z" + "generatedAt": "2026-08-01T15:04:38.726Z" } diff --git a/apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz b/apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz new file mode 100644 index 00000000..7a15ef93 Binary files /dev/null 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 41453955..1e94d867 100644 --- a/apps/benchmark/results/results.json +++ b/apps/benchmark/results/results.json @@ -1,6 +1,6 @@ { "meta": { - "generatedAt": "2026-07-22T14:54:18.341Z", + "generatedAt": "2026-08-02T12:05:10.669Z", "toolchains": [ "ido7.1", "agbcc", @@ -14,7 +14,7 @@ "real": 192 }, "asmlift": { - "commit": "ba104d0d8566fa496f7b1cacfa2eaa1a3e53ae07", + "commit": "f309fec083fbc669836a6aea250dcea84532eecd", "dirty": false }, "m2c": { @@ -38,11 +38,12 @@ ], "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/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L533-L563", + "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, @@ -100,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -119,7 +120,7 @@ ], "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/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L425-L435", + "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": { @@ -129,6 +130,7 @@ "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, @@ -186,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -205,7 +207,7 @@ ], "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/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L410-L423", + "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": { @@ -215,6 +217,7 @@ "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, @@ -272,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -291,7 +294,7 @@ ], "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/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L565-L580", + "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": { @@ -301,6 +304,9 @@ "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, @@ -362,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -382,11 +388,12 @@ ], "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/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L51-L70", + "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, @@ -444,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -463,11 +470,12 @@ ], "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/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L92-L110", + "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, @@ -525,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -544,11 +552,12 @@ ], "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/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L175-L194", + "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, @@ -606,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -625,11 +634,12 @@ ], "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/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L72-L90", + "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, @@ -687,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -706,11 +716,14 @@ ], "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/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L124-L133", + "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, @@ -772,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -792,11 +805,12 @@ ], "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/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L135-L162", + "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, @@ -854,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -873,11 +887,12 @@ ], "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/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L652-L671", + "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, @@ -923,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -942,11 +957,12 @@ ], "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/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L737-L754", + "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, @@ -1004,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -1022,11 +1038,14 @@ ], "loc": 3, "refSource": "Gfx* gfxopen(Gfx* gfxHead) {\n return gfxHead + 1;\n}", - "sourceUrl": "https://github.com/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/gfxalloc.c#L4-L6", + "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, @@ -1076,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -1095,11 +1114,12 @@ ], "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/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L196-L204", + "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, @@ -1157,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -1176,12 +1196,15 @@ ], "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/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/lb_reki.c#L69-L75", + "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, @@ -1243,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -1261,11 +1284,14 @@ ], "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/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/lb_reki.c#L77-L83", + "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, @@ -1315,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -1334,12 +1360,13 @@ ], "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/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/lb_reki.c#L51-L59", + "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, @@ -1385,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -1404,11 +1431,12 @@ ], "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/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_olib.c#L50-L56", + "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, @@ -1466,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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.pprev = NULL;\n this->next = NULL;\n return this;\n}", - "sourceUrl": "https://github.com/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/listalloc.c#L4-L8", + "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, @@ -1536,7 +1567,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -1555,7 +1586,7 @@ ], "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/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L23-L29", + "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": { @@ -1565,6 +1596,7 @@ "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, @@ -1610,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -1629,11 +1661,12 @@ ], "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/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L31-L41", + "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, @@ -1679,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -1698,7 +1731,7 @@ ], "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/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L14-L21", + "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": { @@ -1708,6 +1741,7 @@ "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, @@ -1753,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -1772,12 +1806,13 @@ ], "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/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_room_type.c#L455-L461", + "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, @@ -1835,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -1854,11 +1889,12 @@ ], "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/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_olib.c#L38-L44", + "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, @@ -1916,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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.`r = src->r;\n dest->g = src->g;\n dest->b = src->b;\n dest->a = src->a;\n}", - "sourceUrl": "https://github.com/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L582-L587", + "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": { @@ -1945,6 +1981,9 @@ "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, @@ -1993,7 +2032,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -2012,12 +2051,13 @@ ], "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/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L287-L292", + "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, @@ -2075,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -2094,11 +2134,12 @@ ], "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/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_olib.c#L82-L97", + "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, @@ -2141,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -2160,7 +2201,7 @@ ], "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/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L357-L364", + "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": { @@ -2170,6 +2211,9 @@ "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, @@ -2231,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -2248,11 +2292,12 @@ ], "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/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L236-L240", + "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, @@ -2296,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -2314,11 +2359,12 @@ ], "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/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L254-L258", + "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, @@ -2362,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -2379,11 +2425,12 @@ ], "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/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L248-L252", + "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, @@ -2427,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -2446,7 +2493,7 @@ ], "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/zeldaret/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L242-L246", + "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": { @@ -2456,6 +2503,7 @@ "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, @@ -2499,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -2520,10 +2568,11 @@ ], "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/macabeus/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/code_1.c#L43-L62", + "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, @@ -2553,23 +2602,23 @@ "score": 64, "lines": 31, "gotos": 2, - "casts": 11, + "casts": 9, "unkGlue": 0, "rawMem": 0, "addrDeref": 0 }, "errorMarkers": [ - "agbcc failed: /c.c:1076: conflicting types for `gUnk_03004D80'", + "agbcc failed: /c.c:1077: conflicting types for `gUnk_03004D80'", "/c.c:563: previous declaration of `gUnk_03004D80'", - "/c.c:1086: `unksp0' undeclared (first use in this function)", - "/c.c:1086: (Each undeclared identifier is reported only once", - "/c.c:1086: for each function it appears in.)" + "/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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -2590,10 +2639,11 @@ ], "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/macabeus/kl-eod-decomp/blob/ebe9bd0eccaa3a763a96321af92e17fdede003c4/src/code_3.c#L1752-L1791", + "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, @@ -2629,17 +2679,17 @@ "addrDeref": 0 }, "errorMarkers": [ - "agbcc failed: /c.c:1071: conflicting types for `gUnk_03004670'", + "agbcc failed: /c.c:1072: conflicting types for `gUnk_03004670'", "/c.c:312: previous declaration of `gUnk_03004670'", - "/c.c:1086: warning: dereferencing `void *' pointer", - "/c.c:1086: void value not ignored as it ought to be", - "/c.c:1089: warning: dereferencing `void *' pointer" + "/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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -2659,27 +2709,28 @@ ], "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/macabeus/kl-eod-decomp/blob/ebe9bd0eccaa3a763a96321af92e17fdede003c4/src/code_1.c#L1165-L1180", + "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-f8b523f02efa.i.gz", + "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 >= gUnk_03005220 << 30 >> 30) {\n v2 = 2;\n } else {\n v2 = 0;\n }\n ((u16 *)&gBgTilemapBufs)[(v1 << 1) + 577] = ((u16 *)&gBgTilemapBufs)[(v1 << 1) + (v2 + 20 << 5)];\n ((u16 *)&gBgTilemapBufs)[(v1 << 1) + 578] = ((u16 *)&gBgTilemapBufs)[(v1 << 1) + ((v2 + 20 << 5) + 1)];\n ((u16 *)&gBgTilemapBufs)[(v1 << 1) + 609] = ((u16 *)&gBgTilemapBufs)[(v1 << 1) + (v2 + 21 << 5)];\n v0 = ((u16 *)&gBgTilemapBufs)[(v1 << 1) + ((v2 + 21 << 5) + 1)];\n ((u16 *)&gBgTilemapBufs)[(v1 << 1) + 610] = v0;\n v1 = v1 + 1;\n } while (v1 <= 2);\n return v0;\n}\n", + "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": 88, + "score": 100, "lines": 20, "gotos": 0, - "casts": 9, + "casts": 2, "unkGlue": 0, "rawMem": 0, "addrDeref": 0 }, "errorMarkers": [ - "no scorable candidate for 'CopyBGScrollTiles': agbcc failed: /c.c:1077: invalid operands to binary <<" + "no scorable candidate for 'CopyBGScrollTiles': agbcc failed: /c.c:1078: invalid operands to binary <<" ] }, "m2c": { @@ -2699,13 +2750,13 @@ "addrDeref": 0 }, "errorMarkers": [ - "agbcc failed: /c.c:1081: invalid operands to binary <<" + "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-f8b523f02efa.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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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" + "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" } }, { @@ -2726,42 +2777,30 @@ ], "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/macabeus/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/code_3.c#L110-L121", + "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 - }, - "thunk_HeapAlloc": { - "params": 2 - }, - "thunk_HeapFree": { - "params": 1, - "returnsVoid": true - }, - "HuffUnComp": { - "params": 2, - "returnsVoid": true - }, - "LZ77UnCompWram": { - "params": 2, - "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);\n }\n return;\n}\n", - "score": 12, + "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": 4, + "delete": 3, "replace": 1, "opMismatch": 1, - "argMismatch": 2 + "argMismatch": 1 }, "quality": { "score": 100, @@ -2790,29 +2829,29 @@ "addrDeref": 0 }, "errorMarkers": [ - "agbcc failed: /c.c:1074: warning: dereferencing `void *' pointer", - "/c.c:1074: request for member `unk0' in something not a structure or union", - "/c.c:1075: warning: implicit declaration of function `thunk_HeapAlloc'", - "/c.c:1075: warning: dereferencing `void *' pointer", - "/c.c:1075: request for member `unk4' in something not a structure or union" + "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": 12, + "score": 10, "maxScore": 30, - "ratio": 0.4, + "ratio": 0.3333333333333333, "kinds": { "insert": 4, - "delete": 4, + "delete": 3, "replace": 1, "opMismatch": 1, - "argMismatch": 2 + "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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 \"thunk_HeapAlloc\": {\n \"params\": 2\n },\n \"thunk_HeapFree\": {\n \"params\": 1,\n \"returnsVoid\": true\n },\n \"HuffUnComp\": {\n \"params\": 2,\n \"returnsVoid\": true\n },\n \"LZ77UnCompWram\": {\n \"params\": 2,\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -2833,20 +2872,14 @@ ], "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/macabeus/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/code_3.c#L142-L148", + "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-322c201f79a5.i.gz", - "proto": { - "thunk_HeapAlloc": { - "params": 2 - }, - "Decompress": { - "params": 2, - "returnsVoid": true - } - }, + "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, @@ -2886,14 +2919,14 @@ "addrDeref": 0 }, "errorMarkers": [ - "agbcc failed: /c.c:1076: warning: dereferencing `void *' pointer", - "/c.c:1076: void value not ignored as it ought to be" + "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-322c201f79a5.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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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 prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"thunk_HeapAlloc\": {\n \"params\": 2\n },\n \"Decompress\": {\n \"params\": 2,\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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 --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "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" } }, { @@ -2914,38 +2947,30 @@ ], "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/macabeus/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/code_3.c#L129-L136", + "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 - }, - "thunk_HeapAlloc": { - "params": 2 - }, - "thunk_HeapFree": { - "params": 1, - "returnsVoid": true - }, - "Decompress": { - "params": 2, - "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);\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);\n return;\n}\n", + "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": 38, + "maxScore": 40, "compileErrors": null, "breakdown": { - "insert": 5, + "insert": 7, "delete": 2, "replace": 1, - "opMismatch": 1, - "argMismatch": 10 + "opMismatch": 0, + "argMismatch": 9 }, "quality": { "score": 96, @@ -2974,29 +2999,29 @@ "addrDeref": 0 }, "errorMarkers": [ - "agbcc failed: /c.c:1074: warning: implicit declaration of function `thunk_HeapAlloc'", - "/c.c:1074: warning: assignment makes pointer from integer without a cast", - "/c.c:1075: warning: implicit declaration of function `Decompress'", - "/c.c:1076: invalid type argument of `->'", - "/c.c:1077: invalid type argument of `->'" + "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": 38, - "ratio": 0.5, + "maxScore": 40, + "ratio": 0.475, "kinds": { - "insert": 5, + "insert": 7, "delete": 2, "replace": 1, - "opMismatch": 1, - "argMismatch": 10 + "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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 \"thunk_HeapAlloc\": {\n \"params\": 2\n },\n \"thunk_HeapFree\": {\n \"params\": 1,\n \"returnsVoid\": true\n },\n \"Decompress\": {\n \"params\": 2,\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -3015,10 +3040,13 @@ ], "loc": 3, "refSource": "s16 DivideQ4(s16 num1, s16 num2) {\n return ((num1 << 4) / num2);\n}", - "sourceUrl": "https://github.com/macabeus/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/math.c#L42-L44", + "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, @@ -3068,7 +3096,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -3087,10 +3115,13 @@ ], "loc": 3, "refSource": "s16 DivideQ8(s16 num1, s16 num2) {\n return (num1 << 8) / num2;\n}", - "sourceUrl": "https://github.com/macabeus/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/math.c#L11-L13", + "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, @@ -3140,7 +3171,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -3161,7 +3192,7 @@ ], "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/macabeus/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/gfx.c#L349-L360", + "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": { @@ -3170,8 +3201,16 @@ }, "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 = (struct Elem0 *)*(s32 *)50333640;\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", + "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, @@ -3186,7 +3225,7 @@ "score": 100, "lines": 11, "gotos": 0, - "casts": 2, + "casts": 1, "unkGlue": 0, "rawMem": 0, "addrDeref": 0 @@ -3209,11 +3248,11 @@ "addrDeref": 1 }, "errorMarkers": [ - "agbcc failed: /c.c:1074: warning: assignment makes pointer from integer without a cast", - "/c.c:1075: invalid type argument of `->'", - "/c.c:1075: warning: dereferencing `void *' pointer", - "/c.c:1075: request for member `unk0' in something not a structure or union", - "/c.c:1075: request for member `unk6' in something not a structure or union" + "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": { @@ -3231,7 +3270,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -3251,24 +3290,25 @@ ], "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/macabeus/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/system.c#L91-L110", + "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-afc6f9b0cb86.i.gz", + "ctxRef": "apps/benchmark/dataset/real/tu/kleod/ctx-f808d4b2fde6.i.gz", "proto": { "FreeAllDecompBuffers": { "returnsVoid": true - }, - "thunk_HeapFree": { - "params": 1, - "returnsVoid": true - }, - "m4aSongNumStart": { - "params": 1, - "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, @@ -3308,17 +3348,17 @@ "addrDeref": 2 }, "errorMarkers": [ - "agbcc failed: /c.c:1076: invalid type argument of `->'", - "/c.c:1077: invalid type argument of `->'", + "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: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-afc6f9b0cb86.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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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 \"thunk_HeapFree\": {\n \"params\": 1,\n \"returnsVoid\": true\n },\n \"m4aSongNumStart\": {\n \"params\": 1,\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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" + "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" } }, { @@ -3337,53 +3377,41 @@ ], "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/macabeus/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/code_3.c#L165-L173", + "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 - }, - "UpdateWorldMapNodeState": { - "params": 0, - "returnsVoid": true - }, - "UpdatePlayerInput": { - "params": 0, - "returnsVoid": true - }, - "InitPlayerCollision": { - "params": 0, - "returnsVoid": true - }, - "UpdateWorldMapCursor": { - "params": 0, - "returnsVoid": true - }, - "UpdatePaletteAnimations": { - "params": 0, - "returnsVoid": true } }, "asmlift": { "decompiler": "asmlift", - "outcome": "match", - "source": "void GameUpdate(void) {\n if (*(u8 *)50345188 == 0) {\n UpdateWorldMapNodeState();\n UpdatePlayerInput();\n InitPlayerCollision();\n UpdateWorldMapCursor();\n }\n UpdatePaletteAnimations();\n return;\n}\n", - "score": 0, - "maxScore": 14, + "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": 0, - "delete": 0, + "insert": 1, + "delete": 1, "replace": 0, - "opMismatch": 0, + "opMismatch": 1, "argMismatch": 0 }, "quality": { "score": 100, - "lines": 10, + "lines": 7, "gotos": 0, - "casts": 2, + "casts": 1, "unkGlue": 0, "rawMem": 0, "addrDeref": 0 @@ -3416,7 +3444,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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 \"UpdateWorldMapNodeState\": {\n \"params\": 0,\n \"returnsVoid\": true\n },\n \"UpdatePlayerInput\": {\n \"params\": 0,\n \"returnsVoid\": true\n },\n \"InitPlayerCollision\": {\n \"params\": 0,\n \"returnsVoid\": true\n },\n \"UpdateWorldMapCursor\": {\n \"params\": 0,\n \"returnsVoid\": true\n },\n \"UpdatePaletteAnimations\": {\n \"params\": 0,\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -3437,9 +3465,9 @@ ], "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/macabeus/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/code_3.c#L63-L69", + "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-f8b523f02efa.i.gz", + "ctxRef": "apps/benchmark/dataset/real/tu/kleod/ctx-b4ae03db0859.i.gz", "proto": { "GetEntityLookupData": { "returnsVoid": true @@ -3447,6 +3475,18 @@ }, "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, @@ -3486,11 +3526,11 @@ "addrDeref": 0 }, "errorMarkers": [ - "agbcc failed: /c.c:1074: warning: assignment discards qualifiers from pointer target type", - "/c.c:1075: request for member `unk11' in something not a structure or union", - "/c.c:1075: request for member `unk5' in something not a structure or union", - "/c.c:1076: request for member `unk12' in something not a structure or union", - "/c.c:1076: request for member `unk6' in something not a structure or union" + "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": { @@ -3507,8 +3547,8 @@ } }, "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-f8b523f02efa.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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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" + "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" } }, { @@ -3527,10 +3567,13 @@ ], "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/macabeus/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/math.c#L25-L36", + "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, @@ -3580,7 +3623,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -3599,10 +3642,13 @@ ], "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/macabeus/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/system.c#L116-L127", + "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, @@ -3652,7 +3698,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -3673,12 +3719,20 @@ ], "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/macabeus/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/gfx.c#L536-L566", + "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 *)*(s32 *)50352804)[a0].field_3 >> 7 != 0) {\n return 1;\n } else {\n v0 = ((struct Elem0 *)*(s32 *)50352804)[a0].field_20;\n ((struct Elem0 *)*(s32 *)50352804)[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 (((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, @@ -3693,7 +3747,7 @@ "score": 88, "lines": 19, "gotos": 0, - "casts": 11, + "casts": 8, "unkGlue": 0, "rawMem": 0, "addrDeref": 0 @@ -3716,16 +3770,16 @@ "addrDeref": 5 }, "errorMarkers": [ - "agbcc failed: /c.c:1077: warning: assignment makes pointer from integer without a cast", - "/c.c:1078: warning: dereferencing `void *' pointer", - "/c.c:1078: request for member `unk3' in something not a structure or union", - "/c.c:1078: request for member `unk14' in something not a structure or union" + "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -3746,37 +3800,47 @@ ], "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/macabeus/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/system.c#L44-L57", + "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 - }, - "SoftResetRom": { - "params": [ - "u8" - ], - "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 u16 * v2;\n v0 = *(u16 *)67109168;\n gKeysPressed = (1023 ^ v0) & ~gKeysPrevious;\n gKeysPrevious = 1023 ^ v0;\n if (((1023 ^ v0) & 15) == 15) SoftResetRom(255);\n v1 = gKeysPrevious;\n if ((1 & v1) == 0) {\n gAButtonHold = 1 & v1;\n } else {\n v2 = gAButtonHold;\n gAButtonHold = v2 + 1;\n }\n return;\n}\n", - "score": 40, - "maxScore": 54, + "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": 13, - "delete": 9, + "insert": 17, + "delete": 11, "replace": 3, "opMismatch": 1, - "argMismatch": 14 + "argMismatch": 11 }, "quality": { "score": 100, - "lines": 17, + "lines": 19, "gotos": 0, "casts": 2, "unkGlue": 0, @@ -3811,7 +3875,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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 \"SoftResetRom\": {\n \"params\": [\n \"u8\"\n ],\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -3830,10 +3894,13 @@ ], "loc": 3, "refSource": "u32 ReadUnalignedU16(u8 *ptr) {\n return ptr[0] | (ptr[1] << 8);\n}", - "sourceUrl": "https://github.com/macabeus/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/gfx.c#L54-L56", + "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, @@ -3873,15 +3940,15 @@ "addrDeref": 0 }, "errorMarkers": [ - "agbcc failed: /c.c:1072: warning: dereferencing `void *' pointer", - "/c.c:1072: request for member `unk0' in something not a structure or union", - "/c.c:1072: request for member `unk1' in something not a structure or union" + "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -3901,10 +3968,13 @@ ], "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/macabeus/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/gfx.c#L70-L72", + "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, @@ -3944,17 +4014,17 @@ "addrDeref": 0 }, "errorMarkers": [ - "agbcc failed: /c.c:1072: warning: dereferencing `void *' pointer", - "/c.c:1072: request for member `unk0' in something not a structure or union", - "/c.c:1072: request for member `unk1' in something not a structure or union", - "/c.c:1072: request for member `unk2' in something not a structure or union", - "/c.c:1072: request for member `unk3' in something not a structure or union" + "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -3972,10 +4042,13 @@ ], "loc": 4, "refSource": "s16 ReciprocalQ4(s16 num1) {\n s32 numerator = 0x100;\n return (numerator / num1);\n}", - "sourceUrl": "https://github.com/macabeus/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/math.c#L50-L53", + "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, @@ -4025,7 +4098,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -4043,10 +4116,13 @@ ], "loc": 4, "refSource": "s16 ReciprocalQ8(s16 num1) {\n s32 numerator = 0x10000;\n return (numerator / num1);\n}", - "sourceUrl": "https://github.com/macabeus/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/math.c#L19-L22", + "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, @@ -4096,7 +4172,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -4113,10 +4189,13 @@ ], "loc": 3, "refSource": "s32 ReturnOne(void) {\n return 1;\n}", - "sourceUrl": "https://github.com/macabeus/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/system.c#L12-L14", + "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, @@ -4166,7 +4245,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -4186,7 +4265,7 @@ ], "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/macabeus/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/code_3.c#L80-L89", + "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": { @@ -4195,6 +4274,15 @@ }, "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, @@ -4234,11 +4322,11 @@ "addrDeref": 0 }, "errorMarkers": [ - "agbcc failed: /c.c:1073: conflicting types for `sub_0805193C'", - "/c.c:1071: previous declaration of `sub_0805193C'", - "/c.c:1074: conflicting types for `thunk_sub_080002A0'", - "/c.c:1070: previous declaration of `thunk_sub_080002A0'", - "/c.c:1079: invalid type argument of `->'" + "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": { @@ -4256,7 +4344,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -4275,7 +4363,7 @@ ], "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/macabeus/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/system.c#L16-L25", + "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": { @@ -4284,6 +4372,9 @@ }, "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, @@ -4345,7 +4436,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -4365,27 +4456,30 @@ ], "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/macabeus/kl-eod-decomp/blob/ebe9bd0eccaa3a763a96321af92e17fdede003c4/src/gfx.c#L429-L440", + "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": "s32 StreamCmd_SetBGScroll(void) {\n s32 * v0;\n s32 v1;\n s32 v2;\n u8 * v3;\n s32 v4;\n s32 v5;\n u8 * v6;\n v0 = (s32 *)50351492;\n v1 = ReadUnalignedU16(*v0 + 3);\n v2 = 50345008;\n v3 = (u8 *)*v0;\n v4 = v3[2];\n ((u16 *)(v4 * 28 + v2))[4] = v1 << 4;\n v5 = ReadUnalignedU16(v3 + 5, v4 * 28 + v2, v4, v1 << 4);\n v6 = (u8 *)*v0;\n ((u16 *)(v6[2] * 28 + v2))[5] = v5 << 4;\n *v0 = v6 + 7;\n return v5 << 4;\n}\n", - "score": 25, - "maxScore": 38, + "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": 6, - "delete": 1, - "replace": 3, - "opMismatch": 1, - "argMismatch": 14 + "insert": 0, + "delete": 0, + "replace": 0, + "opMismatch": 0, + "argMismatch": 2 }, "quality": { - "score": 92, - "lines": 20, + "score": 96, + "lines": 19, "gotos": 0, - "casts": 6, + "casts": 4, "unkGlue": 0, "rawMem": 0, "addrDeref": 0 @@ -4408,28 +4502,28 @@ "addrDeref": 4 }, "errorMarkers": [ - "agbcc failed: /c.c:1078: warning: dereferencing `void *' pointer", - "/c.c:1078: request for member `unk2' in something not a structure or union", - "/c.c:1080: warning: dereferencing `void *' pointer", - "/c.c:1080: request for member `unk2' in something not a structure or union" + "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": 25, - "maxScore": 38, - "ratio": 0.6578947368421053, + "score": 2, + "maxScore": 32, + "ratio": 0.0625, "kinds": { - "insert": 6, - "delete": 1, - "replace": 3, - "opMismatch": 1, - "argMismatch": 14 + "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -4449,7 +4543,7 @@ ], "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/macabeus/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/gfx.c#L667-L676", + "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": { @@ -4458,6 +4552,9 @@ }, "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, @@ -4497,11 +4594,11 @@ "addrDeref": 2 }, "errorMarkers": [ - "agbcc failed: /c.c:1075: invalid type argument of `->'", - "/c.c:1075: warning: dereferencing `void *' pointer", - "/c.c:1075: request for member `unk2' in something not a structure or union", - "/c.c:1075: request for member `unk3' in something not a structure or union", - "/c.c:1076: invalid type argument of `->'" + "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": { @@ -4519,7 +4616,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -4540,10 +4637,11 @@ ], "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/macabeus/kl-eod-decomp/blob/ebe9bd0eccaa3a763a96321af92e17fdede003c4/src/code_0.c#L1407-L1464", + "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, @@ -4585,7 +4683,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -4605,33 +4703,19 @@ ], "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/macabeus/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/code_3.c#L40-L48", + "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 - }, - "CheckWorldCompletion": { - "params": [ - "u8" - ] - }, - "CopyWorldMapTiles": { - "params": [ - "u8" - ], - "returnsVoid": true - }, - "UpdateWorldMapNodeTile": { - "params": [ - "u8" - ], - "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, @@ -4681,7 +4765,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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 \"CheckWorldCompletion\": {\n \"params\": [\n \"u8\"\n ]\n },\n \"CopyWorldMapTiles\": {\n \"params\": [\n \"u8\"\n ],\n \"returnsVoid\": true\n },\n \"UpdateWorldMapNodeTile\": {\n \"params\": [\n \"u8\"\n ],\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -4700,14 +4784,22 @@ ], "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/macabeus/kl-eod-decomp/blob/ebe9bd0eccaa3a763a96321af92e17fdede003c4/src/engine.c#L48-L56", + "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-f8b523f02efa.i.gz", + "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, ((u8 *)&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": 6, + "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": { @@ -4715,13 +4807,13 @@ "delete": 1, "replace": 0, "opMismatch": 0, - "argMismatch": 4 + "argMismatch": 2 }, "quality": { "score": 88, "lines": 12, "gotos": 0, - "casts": 9, + "casts": 8, "unkGlue": 0, "rawMem": 0, "addrDeref": 0 @@ -4744,25 +4836,25 @@ "addrDeref": 2 }, "errorMarkers": [ - "agbcc failed: /c.c:1076: request for member `unk8' in something not a structure or union" + "agbcc failed: /c.c:1077: request for member `unk8' in something not a structure or union" ] }, "gapSize": { "decompiler": "asmlift", - "score": 6, + "score": 4, "maxScore": 21, - "ratio": 0.2857142857142857, + "ratio": 0.19047619047619047, "kinds": { "insert": 1, "delete": 1, "replace": 0, "opMismatch": 0, - "argMismatch": 4 + "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-f8b523f02efa.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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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" + "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" } }, { @@ -4782,27 +4874,28 @@ ], "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/macabeus/kl-eod-decomp/blob/ebe9bd0eccaa3a763a96321af92e17fdede003c4/src/code_1.c#L1184-L1218", + "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-f8b523f02efa.i.gz", + "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 (((u8 *)&gUnk_03004C20)[10] == 1) {\n v2 = 100;\n } else {\n if (((u8 *)&gUnk_03004C20)[12] != 6) {\n v2 = 30;\n } else {\n v2 = 100;\n }\n }\n v0 = gUnk_03005220;\n if (v2 != v0 << 20 >> 25) {\n v3 = 0;\n } else {\n v3 = 1;\n }\n if (((u8 *)&gUnk_03004C20)[10] == 1) {\n if (v0 << 20 >> 25 <= 99) {\n v4 = 1;\n v5 = &gBgTilemapBufs;\n } else {\n ((u16 *)&gBgTilemapBufs)[594] = ((u16 *)&gBgTilemapBufs)[659];\n ((u16 *)&gBgTilemapBufs)[626] = ((u16 *)&gBgTilemapBufs)[691];\n v4 = 1;\n v5 = &gBgTilemapBufs;\n }\n } else {\n if (((u8 *)&gUnk_03004C20)[12] != 6) {\n v4 = 0;\n v5 = &gBgTilemapBufs;\n } else {\n if (v0 << 20 >> 25 <= 99) {\n v4 = 1;\n v5 = &gBgTilemapBufs;\n } else {\n ((u16 *)&gBgTilemapBufs)[594] = ((u16 *)&gBgTilemapBufs)[659];\n ((u16 *)&gBgTilemapBufs)[626] = ((u16 *)&gBgTilemapBufs)[691];\n v4 = 1;\n v5 = &gBgTilemapBufs;\n }\n }\n }\n v1 = 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[(gUnk_03005220 << 20 >> 25) / 10 + 690];\n }\n v5[597 - v4] = v5[(gUnk_03005220 << 20 >> 25) % 10 + 658];\n v5[629 - v4] = v5[(gUnk_03005220 << 20 >> 25) % 10 + 690];\n return v3;\n}\n", + "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": 88, + "score": 94, "lines": 57, "gotos": 0, - "casts": 12, + "casts": 5, "unkGlue": 0, "rawMem": 0, "addrDeref": 0 }, "errorMarkers": [ - "no scorable candidate for 'UpdateHUDCounterDisplay': agbcc failed: /c.c:1087: incompatible types in assignment" + "no scorable candidate for 'UpdateHUDCounterDisplay': agbcc failed: /c.c:1088: incompatible types in assignment" ] }, "m2c": { @@ -4822,17 +4915,17 @@ "addrDeref": 0 }, "errorMarkers": [ - "agbcc failed: /c.c:1084: invalid operands to binary <<", - "/c.c:1097: invalid operands to binary <<", - "/c.c:1099: request for member `unk0' in something not a structure or union", + "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:1100: invalid operands to binary <<" + "/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-f8b523f02efa.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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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" + "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" } }, { @@ -4852,11 +4945,12 @@ ], "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/macabeus/kl-eod-decomp/blob/ebe9bd0eccaa3a763a96321af92e17fdede003c4/src/code_3.c#L1849-L1870", + "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-f8b523f02efa.i.gz", + "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, @@ -4913,8 +5007,8 @@ } }, "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-f8b523f02efa.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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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" + "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" } }, { @@ -4933,26 +5027,26 @@ ], "loc": 5, "refSource": "void VBlankHandlerMinimal(void) {\n m4aSoundVSync();\n m4aSoundMain();\n gIMEAcknowledge = 1;\n}", - "sourceUrl": "https://github.com/macabeus/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/math.c#L71-L75", + "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 - }, - "m4aSoundVSync": { - "params": 0, - "returnsVoid": true - }, - "m4aSoundMain": { - "params": 0, - "returnsVoid": true } }, "asmlift": { "decompiler": "asmlift", + "symbolMap": true, + "candidateLabel": "unsigned", + "symbolsUsed": [ + { + "name": "gIMEAcknowledge", + "shape": "scalar u16" + } + ], "outcome": "match", - "source": "void VBlankHandlerMinimal(void) {\n m4aSoundVSync();\n m4aSoundMain();\n *(u16 *)50364408 = 1;\n return;\n}\n", + "source": "void VBlankHandlerMinimal(void) {\n m4aSoundMain(m4aSoundVSync());\n gIMEAcknowledge = 1;\n return;\n}\n", "score": 0, "maxScore": 9, "compileErrors": null, @@ -4965,9 +5059,9 @@ }, "quality": { "score": 100, - "lines": 6, + "lines": 5, "gotos": 0, - "casts": 2, + "casts": 1, "unkGlue": 0, "rawMem": 0, "addrDeref": 0 @@ -5000,7 +5094,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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 \"m4aSoundVSync\": {\n \"params\": 0,\n \"returnsVoid\": true\n },\n \"m4aSoundMain\": {\n \"params\": 0,\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -5021,18 +5115,18 @@ ], "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/macabeus/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/gfx.c#L448-L454", + "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 - }, - "ReadUnalignedU16": { - "params": 1 } }, "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, @@ -5072,17 +5166,17 @@ "addrDeref": 3 }, "errorMarkers": [ - "agbcc failed: /c.c:1072: conflicting types for `ReadUnalignedU16'", - "/c.c:1070: previous declaration of `ReadUnalignedU16'", - "/c.c:1078: warning: dereferencing `void *' pointer", - "/c.c:1078: request for member `unk2' in something not a structure or union", - "/c.c:1078: warning: passing arg 1 of `ReadUnalignedU16' makes integer from pointer without a cast" + "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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 \"ReadUnalignedU16\": {\n \"params\": 1\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -5102,7 +5196,7 @@ ], "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/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/camera.c#L72-L78", + "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": { @@ -5110,9 +5204,10 @@ "returnsVoid": true } }, - "asmDump": "\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /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", + "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, @@ -5158,7 +5253,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -5176,16 +5271,29 @@ ], "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/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/graphics.c#L225-L229", + "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 /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", + "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, @@ -5235,7 +5343,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -5254,7 +5362,7 @@ ], "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/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/graphics.c#L237-L242", + "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": { @@ -5262,9 +5370,25 @@ "returnsVoid": true } }, - "asmDump": "\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /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", + "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, @@ -5325,7 +5449,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -5344,7 +5468,7 @@ ], "loc": 3, "refSource": "void func_8000F088_FC88(s32 *uCodeAdresses) {\n gUCodeAddresses = uCodeAdresses;\n}", - "sourceUrl": "https://github.com/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/graphics.c#L245-L247", + "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": { @@ -5352,9 +5476,16 @@ "returnsVoid": true } }, - "asmDump": "\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /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", + "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, @@ -5404,7 +5535,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -5423,11 +5554,12 @@ ], "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/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/hmfload.c#L31-L43", + "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 /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", + "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, @@ -5485,7 +5617,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -5502,7 +5634,7 @@ ], "loc": 3, "refSource": "void func_800123F4_12FF4(void) {\n D_800D418E_D4D8E = D_800D2008_D2C08;\n}", - "sourceUrl": "https://github.com/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/camera.c#L53-L55", + "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": { @@ -5510,9 +5642,19 @@ "returnsVoid": true } }, - "asmDump": "\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /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", + "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, @@ -5562,7 +5704,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -5579,7 +5721,7 @@ ], "loc": 3, "refSource": "void func_8001D330_1DF30(s16 arg0) {\n D_800A0A78_A1678 = arg0;\n}", - "sourceUrl": "https://github.com/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/hmfman.c#L525-L527", + "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": { @@ -5587,9 +5729,16 @@ "returnsVoid": true } }, - "asmDump": "\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /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", + "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, @@ -5639,7 +5788,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -5659,7 +5808,7 @@ ], "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/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/hmfman.c#L615-L624", + "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": { @@ -5667,9 +5816,17 @@ "returnsVoid": true } }, - "asmDump": "\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /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", + "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, @@ -5719,7 +5876,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -5738,7 +5895,7 @@ ], "loc": 3, "refSource": "void func_8002FD48_30948(HmfData *arg0) {\n arg0->unkA0 = 0;\n}", - "sourceUrl": "https://github.com/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/22EB0.c#L208-L210", + "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": { @@ -5746,9 +5903,12 @@ "returnsVoid": true } }, - "asmDump": "\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /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", + "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, @@ -5798,7 +5958,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -5816,11 +5976,18 @@ ], "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/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/gamemes.c#L743-L752", + "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 /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", + "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, @@ -5882,7 +6049,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -5904,7 +6071,7 @@ ], "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/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/pause.c#L61-L73", + "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": { @@ -5912,9 +6079,10 @@ "returnsVoid": true } }, - "asmDump": "\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /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", + "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, @@ -5959,7 +6127,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -5979,12 +6147,13 @@ ], "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/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/pause.c#L217-L230", + "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 /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", + "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, @@ -6042,7 +6211,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -6061,7 +6230,7 @@ ], "loc": 3, "refSource": "void func_80047E90_48A90(omObjData *obj, s32 arg1) {\n obj->unk10 |= arg1;\n}", - "sourceUrl": "https://github.com/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/objmain.c#L516-L518", + "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": { @@ -6069,9 +6238,12 @@ "returnsVoid": true } }, - "asmDump": "\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /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", + "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, @@ -6121,7 +6293,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -6138,7 +6310,7 @@ ], "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/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/objmain.c#L1053-L1057", + "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": { @@ -6146,9 +6318,22 @@ "returnsVoid": true } }, - "asmDump": "\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /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", + "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, @@ -6198,7 +6383,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -6215,7 +6400,7 @@ ], "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/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/objmain.c#L1059-L1065", + "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": { @@ -6223,9 +6408,28 @@ "returnsVoid": true } }, - "asmDump": "\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /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", + "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, @@ -6275,7 +6479,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -6294,7 +6498,7 @@ ], "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/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/sprman.c#L213-L225", + "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": { @@ -6302,9 +6506,10 @@ "returnsVoid": true } }, - "asmDump": "\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /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", + "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, @@ -6350,7 +6555,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -6370,12 +6575,13 @@ ], "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/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/sprman.c#L636-L638", + "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 /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", + "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, @@ -6417,7 +6623,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -6437,7 +6643,7 @@ ], "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/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/sprman.c#L650-L654", + "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": { @@ -6445,9 +6651,10 @@ "returnsVoid": true } }, - "asmDump": "\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /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", + "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, @@ -6489,7 +6696,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -6508,7 +6715,7 @@ ], "loc": 3, "refSource": "void *func_80056254_56E54(HuSprite_Unk84_Struct **arg0) {\n return (*arg0)->unk0C;\n}", - "sourceUrl": "https://github.com/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/sprman.c#L676-L678", + "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": { @@ -6516,9 +6723,12 @@ "returnsVoid": true } }, - "asmDump": "\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /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", + "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, @@ -6568,7 +6778,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -6588,7 +6798,7 @@ ], "loc": 3, "refSource": "void *func_80056260_56E60(s16 arg0) {\n return D_800C9530_CA130[arg0]->unk0C;\n}", - "sourceUrl": "https://github.com/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/sprman.c#L680-L682", + "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": { @@ -6596,9 +6806,10 @@ "returnsVoid": true } }, - "asmDump": "\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /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", + "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, @@ -6640,7 +6851,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -6658,11 +6869,14 @@ ], "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/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/sprman.c#L777-L783", + "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 /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", + "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, @@ -6724,7 +6938,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -6745,7 +6959,7 @@ ], "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/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/sprman.c#L823-L834", + "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": { @@ -6753,9 +6967,10 @@ "returnsVoid": true } }, - "asmDump": "\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /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", + "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, @@ -6801,7 +7016,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -6822,12 +7037,13 @@ ], "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/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/window.c#L297-L313", + "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 /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", + "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, @@ -6872,7 +7088,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -6893,7 +7109,7 @@ ], "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/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/window.c#L325-L334", + "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": { @@ -6901,9 +7117,17 @@ "returnsVoid": true } }, - "asmDump": "\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /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", + "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, @@ -6965,7 +7189,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -6982,12 +7206,20 @@ ], "loc": 3, "refSource": "s8 func_8006014C_60D4C(s32 winId) {\n return D_800CC69C_CD29C[winId].unk_31;\n}", - "sourceUrl": "https://github.com/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/window.c#L345-L347", + "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 /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", + "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, @@ -7037,7 +7269,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -7056,7 +7288,7 @@ ], "loc": 3, "refSource": "void func_80071B40_72740(ALVoice *voice, s16 priority) {\n voice->priority = priority;\n}", - "sourceUrl": "https://github.com/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/72740.c#L3-L5", + "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": { @@ -7064,9 +7296,12 @@ "returnsVoid": true } }, - "asmDump": "\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /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", + "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, @@ -7116,7 +7351,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -7135,7 +7370,7 @@ ], "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/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/8ACD0.c#L3-L18", + "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": { @@ -7143,9 +7378,12 @@ "returnsVoid": true } }, - "asmDump": "\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /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", + "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, @@ -7195,7 +7433,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -7214,28 +7452,44 @@ ], "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/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/save.c#L80-L91", + "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 /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", - "outcome": "declined", - "source": "/* asmlift could not decompile 'GWBoardRecordGet' — contract: structuring emitted ill-typed C in 'GWBoardRecordGet': interior pointer arithmetic on the global address '&GwCommon' (+1 more) */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\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... */\nvoid GWBoardRecordGet(void) {\n ASMLIFT_ERROR(\"could not decompile (contract): structuring emitted ill-typed C in 'GWBoardRecordGet': interior pointer arithmetic on the global address '&GwCommon' (+1 more)\");\n}\n", - "score": null, - "maxScore": null, + "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": 88, - "lines": 35, + "score": 100, + "lines": 13, "gotos": 0, - "casts": 1, - "unkGlue": 1, + "casts": 0, + "unkGlue": 0, "rawMem": 0, "addrDeref": 0 - }, - "errorMarkers": [ - "contract: structuring emitted ill-typed C in 'GWBoardRecordGet': interior pointer arithmetic on the global address '&GwCommon' (+1 more)" - ] + } }, "m2c": { "decompiler": "m2c", @@ -7257,10 +7511,22 @@ "? placeholder" ] }, - "gapSize": null, + "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -7277,18 +7543,26 @@ ], "loc": 3, "refSource": "void GWMgNoSet(s8 arg0) {\n GwSystem.minigame_index = arg0;\n}", - "sourceUrl": "https://github.com/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/save.c#L17-L19", + "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 /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", + "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 ((u8 *)&GwSystem)[16] = a0;\n return;\n}\n", + "source": "void GWMgNoSet(u32 a0) {\n GwSystem.minigame_index = a0;\n return;\n}\n", "score": 0, "maxScore": 3, "compileErrors": null, @@ -7303,7 +7577,7 @@ "score": 100, "lines": 4, "gotos": 0, - "casts": 1, + "casts": 0, "unkGlue": 0, "rawMem": 0, "addrDeref": 0 @@ -7336,7 +7610,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -7356,12 +7630,15 @@ ], "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/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/malloc.c#L158-L170", + "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 /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", + "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, @@ -7411,7 +7688,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -7432,12 +7709,15 @@ ], "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/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/malloc.c#L139-L153", + "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 /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", + "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, @@ -7487,7 +7767,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -7507,7 +7787,7 @@ ], "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/mariopartyrd/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/process.c#L45-L54", + "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": { @@ -7515,9 +7795,12 @@ "returnsVoid": true } }, - "asmDump": "\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /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", + "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, @@ -7567,7 +7850,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -7587,10 +7870,13 @@ ], "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/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/util.c#L256-L262", + "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, @@ -7636,7 +7922,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -7656,10 +7942,13 @@ ], "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/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/util.c#L222-L239", + "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, @@ -7717,7 +8006,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -7738,11 +8027,12 @@ ], "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/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/util.c#L241-L254", + "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, @@ -7800,7 +8090,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -7822,11 +8112,23 @@ ], "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/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/pokemon.c#L4636-L4640", + "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, @@ -7888,7 +8190,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -7906,15 +8208,13 @@ ], "loc": 4, "refSource": "s16 Cos2(u16 angle)\n{\n return Sin2(angle + 90);\n}", - "sourceUrl": "https://github.com/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/trig.c#L540-L543", + "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", - "proto": { - "Sin2": { - "params": 1 - } - }, "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, @@ -7964,7 +8264,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"Sin2\": {\n \"params\": 1\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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 --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout'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: 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" } }, { @@ -7984,10 +8284,13 @@ ], "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/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/util.c#L208-L220", + "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, @@ -8049,7 +8352,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -8068,10 +8371,18 @@ ], "loc": 5, "refSource": "static u16 FeebasRandom(void)\n{\n sFeebasRngValue = ISO_RANDOMIZE2(sFeebasRngValue);\n return sFeebasRngValue >> 16;\n}", - "sourceUrl": "https://github.com/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/wild_encounter.c#L170-L174", + "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, @@ -8133,7 +8444,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -8153,11 +8464,19 @@ ], "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/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/pokemon.c#L3471-L3485", + "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, @@ -8195,10 +8514,10 @@ "argMismatch": 7 }, "quality": { - "score": 94, + "score": 96, "lines": 15, "gotos": 0, - "casts": 5, + "casts": 4, "unkGlue": 0, "rawMem": 0, "addrDeref": 0 @@ -8219,7 +8538,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -8239,20 +8558,19 @@ ], "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/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/berry_powder.c#L162-L176", + "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", - "proto": { - "DecryptBerryPowder": { - "params": 1 - }, - "SetBerryPowder": { - "returnsVoid": true, - "params": 2 - } - }, "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, @@ -8314,7 +8632,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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 prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"DecryptBerryPowder\": {\n \"params\": 1\n },\n \"SetBerryPowder\": {\n \"returnsVoid\": true,\n \"params\": 2\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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 --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout'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: 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" } }, { @@ -8334,10 +8652,13 @@ ], "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/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/string_util.c#L152-L161", + "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, @@ -8395,7 +8716,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -8416,7 +8737,7 @@ ], "loc": 4, "refSource": "void LoadWordFromTwoHalfwords(u16 *h, u32 *w)\n{\n *w = h[0] | (s16)h[1] << 16;\n}", - "sourceUrl": "https://github.com/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/util.c#L133-L136", + "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": { @@ -8425,17 +8746,20 @@ }, "asmlift": { "decompiler": "asmlift", + "symbolMap": true, + "candidateLabel": "unsigned", + "symbolsUsed": [], "outcome": "nonmatch", - "source": "void LoadWordFromTwoHalfwords(u16 * a0, s32 * a1) {\n *a1 = *a0 | *a0 << 16;\n return;\n}\n", - "score": 6, + "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": 2, + "delete": 1, "replace": 1, "opMismatch": 0, - "argMismatch": 3 + "argMismatch": 0 }, "quality": { "score": 100, @@ -8471,20 +8795,20 @@ }, "gapSize": { "decompiler": "asmlift", - "score": 6, + "score": 2, "maxScore": 7, - "ratio": 0.8571428571428571, + "ratio": 0.2857142857142857, "kinds": { "insert": 0, - "delete": 2, + "delete": 1, "replace": 1, "opMismatch": 0, - "argMismatch": 3 + "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -8504,10 +8828,13 @@ ], "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/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/math_util.c#L33-L40", + "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, @@ -8569,7 +8896,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -8589,10 +8916,13 @@ ], "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/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/math_util.c#L42-L49", + "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, @@ -8654,7 +8984,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -8672,10 +9002,13 @@ ], "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/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/math_util.c#L64-L70", + "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, @@ -8725,7 +9058,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -8744,10 +9077,13 @@ ], "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/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/math_util.c#L3-L11", + "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, @@ -8797,7 +9133,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -8817,10 +9153,13 @@ ], "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/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/math_util.c#L13-L21", + "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, @@ -8882,7 +9221,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -8902,10 +9241,11 @@ ], "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/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/math_util.c#L23-L31", + "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, @@ -8947,7 +9287,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -8968,28 +9308,36 @@ ], "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/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/pokemon.c#L5864-L5898", + "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 = ((u8 *)&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": 48, + "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": 14, - "replace": 10, - "opMismatch": 1, - "argMismatch": 9 + "delete": 10, + "replace": 14, + "opMismatch": 2, + "argMismatch": 7 }, "quality": { "score": 84, "lines": 19, "gotos": 0, - "casts": 12, + "casts": 11, "unkGlue": 0, "rawMem": 0, "addrDeref": 0 @@ -9034,7 +9382,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -9053,20 +9401,19 @@ ], "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/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/malloc.c#L42-L45", + "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 - }, - "PutMemBlockHeader": { - "returnsVoid": true, - "params": 4 } }, "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, @@ -9116,7 +9463,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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 \"PutMemBlockHeader\": {\n \"returnsVoid\": true,\n \"params\": 4\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -9135,7 +9482,7 @@ ], "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/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/malloc.c#L31-L40", + "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": { @@ -9144,6 +9491,9 @@ }, "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, @@ -9193,7 +9543,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -9213,10 +9563,22 @@ ], "loc": 6, "refSource": "u16 Random(void)\n{\n gRngValue = ISO_RANDOMIZE1(gRngValue);\n sRandCount++;\n return gRngValue >> 16;\n}", - "sourceUrl": "https://github.com/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/random.c#L11-L16", + "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, @@ -9278,7 +9640,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -9297,10 +9659,13 @@ ], "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/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/script.c#L52-L57", + "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, @@ -9349,7 +9714,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -9370,11 +9735,19 @@ ], "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/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/trig.c#L527-L537", + "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, @@ -9436,7 +9809,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -9456,7 +9829,7 @@ ], "loc": 5, "refSource": "void StopScript(struct ScriptContext *ctx)\n{\n ctx->mode = SCRIPT_MODE_STOPPED;\n ctx->scriptPtr = NULL;\n}", - "sourceUrl": "https://github.com/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/script.c#L65-L69", + "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": { @@ -9465,6 +9838,9 @@ }, "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, @@ -9513,7 +9889,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -9533,7 +9909,7 @@ ], "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/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/util.c#L127-L131", + "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": { @@ -9542,6 +9918,9 @@ }, "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, @@ -9590,7 +9969,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -9610,16 +9989,14 @@ ], "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/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/string_util.c#L88-L94", + "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", - "proto": { - "StringCopy": { - "params": 2 - } - }, "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, @@ -9669,7 +10046,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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 prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"StringCopy\": {\n \"params\": 2\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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 --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout'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: 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" } }, { @@ -9689,10 +10066,11 @@ ], "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/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/string_util.c#L124-L135", + "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, @@ -9750,7 +10128,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -9770,10 +10148,13 @@ ], "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/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/string_util.c#L137-L150", + "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, @@ -9823,7 +10204,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -9842,10 +10223,13 @@ ], "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/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/string_util.c#L75-L86", + "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, @@ -9895,7 +10279,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -9914,10 +10298,13 @@ ], "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/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/string_util.c#L96-L104", + "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, @@ -9975,7 +10362,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -9995,10 +10382,13 @@ ], "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/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/string_util.c#L114-L122", + "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, @@ -10048,7 +10438,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -10069,10 +10459,11 @@ ], "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/pret/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/pokemon_size_record.c#L67-L77", + "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, @@ -10106,10 +10497,10 @@ "argMismatch": 1 }, "quality": { - "score": 84, + "score": 86, "lines": 19, "gotos": 1, - "casts": 4, + "casts": 3, "unkGlue": 0, "rawMem": 0, "addrDeref": 0 @@ -10130,7 +10521,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -10149,10 +10540,13 @@ ], "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/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L433-L447", + "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, @@ -10202,7 +10596,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -10222,10 +10616,13 @@ ], "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/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/sprite.c#L147-L164", + "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, @@ -10288,7 +10685,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -10309,7 +10706,7 @@ ], "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/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/malloc_ewram.c#L63-L97", + "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": { @@ -10319,6 +10716,7 @@ }, "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, @@ -10364,7 +10762,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -10384,7 +10782,7 @@ ], "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/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/malloc_ewram.c#L7-L12", + "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": { @@ -10394,6 +10792,14 @@ }, "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, @@ -10440,7 +10846,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -10461,11 +10867,12 @@ ], "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/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/malloc_ewram.c#L14-L61", + "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, @@ -10511,7 +10918,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -10533,23 +10940,17 @@ ], "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/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/core.c#L971-L1020", + "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 - }, - "InputRecorderRead": { - "params": 0 - }, - "InputRecorderWrite": { - "params": 1, - "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, @@ -10607,7 +11008,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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 \"InputRecorderRead\": {\n \"params\": 0\n },\n \"InputRecorderWrite\": {\n \"params\": 1,\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -10628,10 +11029,13 @@ ], "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/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/code_0_0.c#L1036-L1050", + "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, @@ -10689,7 +11093,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -10710,7 +11114,7 @@ ], "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/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/sprite.c#L127-L141", + "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": { @@ -10719,6 +11123,9 @@ }, "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, @@ -10778,7 +11185,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -10799,11 +11206,12 @@ ], "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/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/sprite.c#L931-L957", + "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, @@ -10847,7 +11255,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -10868,11 +11276,12 @@ ], "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/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/sprite.c#L959-L1029", + "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, @@ -10918,7 +11327,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -10937,11 +11346,12 @@ ], "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/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L402-L425", + "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, @@ -10985,7 +11395,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -11006,16 +11416,12 @@ ], "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/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/sprite.c#L73-L125", + "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", - "proto": { - "memcpy": { - "params": 3 - } - }, "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, @@ -11059,7 +11465,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\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# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"memcpy\": {\n \"params\": 3\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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 --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout'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: 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" } }, { @@ -11080,7 +11486,7 @@ ], "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/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/bg_triangles.c#L826-L848", + "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": { @@ -11089,6 +11495,7 @@ }, "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, @@ -11134,7 +11541,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -11154,10 +11561,11 @@ ], "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/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/bg_triangles.c#L850-L864", + "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, @@ -11203,7 +11611,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -11224,7 +11632,7 @@ ], "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/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/bg_triangles.c#L866-L888", + "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": { @@ -11233,6 +11641,7 @@ }, "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, @@ -11278,7 +11687,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -11299,7 +11708,7 @@ ], "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/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L67-L92", + "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": { @@ -11309,25 +11718,33 @@ }, "asmlift": { "decompiler": "asmlift", + "symbolMap": true, + "candidateLabel": "unsigned/raw-globals", + "symbolsUsed": [ + { + "name": "gSineTable", + "shape": "s16[]" + } + ], "outcome": "nonmatch", - "source": "struct Struct0 { s16 field_0; u8 _pad0[6]; s32 field_8; s32 field_12; };\nstruct Struct1 { s16 field_0; u8 _pad0[6]; s32 field_8; s32 field_12; };\nstruct Struct2 { u16 field_0; u16 field_2; u16 field_4; s32 field_8; s32 field_12; };\nvoid sa2__sub_8083504(struct Struct1 * a0, struct Struct0 * a1, struct Struct2 * 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 = a1->field_0;\n if (v0 == 128 << 3) {\n v4 = a0->field_8;\n } else {\n v1 = a0->field_8;\n a2->field_2 = a0->field_0 * v0 >> 10;\n v4 = v1 * v0 >> 10;\n }\n v2 = a1->field_0;\n if (v2 == 128 << 3) {\n v5 = a0->field_12;\n } else {\n v3 = a0->field_12;\n a2->field_4 = a0->field_0 * 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": 87, - "maxScore": 124, + "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": 16, - "delete": 14, - "replace": 14, - "opMismatch": 4, + "insert": 17, + "delete": 15, + "replace": 11, + "opMismatch": 3, "argMismatch": 39 }, "quality": { - "score": 100, + "score": 78, "lines": 40, "gotos": 0, - "casts": 1, + "casts": 5, "unkGlue": 0, - "rawMem": 0, + "rawMem": 4, "addrDeref": 0 } }, @@ -11357,20 +11774,20 @@ }, "gapSize": { "decompiler": "asmlift", - "score": 87, - "maxScore": 124, - "ratio": 0.7016129032258065, + "score": 85, + "maxScore": 125, + "ratio": 0.68, "kinds": { - "insert": 16, - "delete": 14, - "replace": 14, - "opMismatch": 4, + "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -11390,7 +11807,7 @@ ], "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/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L177-L183", + "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": { @@ -11399,17 +11816,20 @@ }, "asmlift": { "decompiler": "asmlift", + "symbolMap": true, + "candidateLabel": "unsigned", + "symbolsUsed": [], "outcome": "nonmatch", - "source": "void sa2__sub_80838CC(s16 * a0, s16 * a1, u16 * a2) {\n *a2 = *a1 * *a0 + *a1 * *a0 + *a1 * *a0 - *a1 * *a0 >> 10;\n a2[1] = *a1 * *a0 - *a1 * *a0 + *a1 * *a0 + *a1 * *a0 >> 10;\n a2[2] = *a1 * *a0 + *a1 * *a0 - *a1 * *a0 + *a1 * *a0 >> 10;\n a2[3] = *a1 * *a0 - *a1 * *a0 - *a1 * *a0 - *a1 * *a0 >> 10;\n return;\n}\n", - "score": 95, - "maxScore": 107, + "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": 3, - "delete": 70, - "replace": 3, + "insert": 0, + "delete": 0, + "replace": 0, "opMismatch": 0, - "argMismatch": 19 + "argMismatch": 59 }, "quality": { "score": 100, @@ -11447,20 +11867,20 @@ }, "gapSize": { "decompiler": "asmlift", - "score": 95, - "maxScore": 107, - "ratio": 0.8878504672897196, + "score": 59, + "maxScore": 104, + "ratio": 0.5673076923076923, "kinds": { - "insert": 3, - "delete": 70, - "replace": 3, + "insert": 0, + "delete": 0, + "replace": 0, "opMismatch": 0, - "argMismatch": 19 + "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -11480,7 +11900,7 @@ ], "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/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L185-L194", + "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": { @@ -11489,17 +11909,20 @@ }, "asmlift": { "decompiler": "asmlift", + "symbolMap": true, + "candidateLabel": "unsigned", + "symbolsUsed": [], "outcome": "nonmatch", - "source": "void sa2__sub_808399C(s16 * a0, s16 * a1) {\n s32 v0;\n s32 v1;\n s32 v2;\n v0 = *a0;\n v1 = *a0;\n v2 = *a0;\n *a0 = *a1 * *a0 + *a1 * v0 + *a1 * v1 - *a1 * v2 >> 10;\n a0[1] = *a1 * *a0 - *a1 * v0 + *a1 * v1 + *a1 * v2 >> 10;\n a0[2] = *a1 * *a0 + *a1 * v0 - *a1 * v1 + *a1 * v2 >> 10;\n a0[3] = *a1 * *a0 - *a1 * v0 - *a1 * v1 - *a1 * v2 >> 10;\n return;\n}\n", - "score": 78, - "maxScore": 87, + "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": 1, - "delete": 48, - "replace": 2, + "insert": 4, + "delete": 11, + "replace": 3, "opMismatch": 0, - "argMismatch": 27 + "argMismatch": 23 }, "quality": { "score": 100, @@ -11537,20 +11960,20 @@ }, "gapSize": { "decompiler": "asmlift", - "score": 78, - "maxScore": 87, - "ratio": 0.896551724137931, + "score": 41, + "maxScore": 90, + "ratio": 0.45555555555555555, "kinds": { - "insert": 1, - "delete": 48, - "replace": 2, + "insert": 4, + "delete": 11, + "replace": 3, "opMismatch": 0, - "argMismatch": 27 + "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -11570,10 +11993,13 @@ ], "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/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L469-L482", + "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, @@ -11635,7 +12061,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -11654,10 +12080,13 @@ ], "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/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L484-L489", + "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, @@ -11719,7 +12148,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -11739,10 +12168,11 @@ ], "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/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L509-L517", + "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, @@ -11800,7 +12230,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -11818,10 +12248,13 @@ ], "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/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L529-L529", + "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, @@ -11871,7 +12304,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -11889,10 +12322,13 @@ ], "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/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L531-L531", + "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, @@ -11942,7 +12378,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -11960,10 +12396,13 @@ ], "loc": 1, "refSource": "s32 SA2_LABEL(sub_8085714)(s32 a, s32 b, s32 c) { return ((a + b * 8) - c) >> 3; }", - "sourceUrl": "https://github.com/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L533-L533", + "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, @@ -12013,7 +12452,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -12031,10 +12470,13 @@ ], "loc": 1, "refSource": "s32 SA2_LABEL(sub_8085720)(s32 a, s32 b, s32 c) { return ((b * 8 - a) + c) >> 3; }", - "sourceUrl": "https://github.com/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L535-L535", + "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, @@ -12084,7 +12526,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -12101,10 +12543,13 @@ ], "loc": 1, "refSource": "s32 SA2_LABEL(sub_8085758)(s32 a, s32 b) { return b - a; }", - "sourceUrl": "https://github.com/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L539-L539", + "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, @@ -12154,7 +12599,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -12172,10 +12617,13 @@ ], "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/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L549-L549", + "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, @@ -12225,7 +12673,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -12243,10 +12691,13 @@ ], "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/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L580-L587", + "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, @@ -12296,7 +12747,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -12314,7 +12765,7 @@ ], "loc": 5, "refSource": "void SeedRng(u32 a, u32 b)\n{\n gRngPrevValue = a;\n gRngValue = b;\n}", - "sourceUrl": "https://github.com/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L427-L431", + "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": { @@ -12323,6 +12774,18 @@ }, "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, @@ -12372,7 +12835,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -12392,10 +12855,13 @@ ], "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/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/lib/agb_flash/agb_flash.c#L286-L294", + "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, @@ -12457,7 +12923,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -12477,13 +12943,25 @@ ], "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/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/malloc_vram.c#L46-L58", + "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", - "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 (((u16 *)&gVramHeapState)[v1] != 0) {\n v2 = (u16)(v2 + ((u16 *)&gVramHeapState)[v1]);\n v1 = (u16)(((u16 *)&gVramHeapState)[v1] + (v1 + 65535));\n }\n v1 = (u16)(v1 + 1);\n } while (v1 < v0 >> 2);\n }\n return v2 << 18 >> 16;\n}\n", + "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, @@ -12495,10 +12973,10 @@ "argMismatch": 11 }, "quality": { - "score": 90, + "score": 96, "lines": 20, "gotos": 0, - "casts": 7, + "casts": 4, "unkGlue": 0, "rawMem": 0, "addrDeref": 0 @@ -12543,7 +13021,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -12565,11 +13043,12 @@ ], "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/SAT-R/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/malloc_vram.c#L5-L31", + "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, @@ -12627,7 +13106,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -12646,7 +13125,7 @@ ], "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/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/10AD0.c#L32-L39", + "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": { @@ -12656,23 +13135,34 @@ "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", - "outcome": "declined", - "source": "/* asmlift could not decompile 'func_80014440_15040' — contract: structuring emitted ill-typed C in 'func_80014440_15040': interior pointer arithmetic on the global address '&gDefaultFontPalette' */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\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... */\nvoid func_80014440_15040(void) {\n ASMLIFT_ERROR(\"could not decompile (contract): structuring emitted ill-typed C in 'func_80014440_15040': interior pointer arithmetic on the global address '&gDefaultFontPalette'\");\n}\n", - "score": null, - "maxScore": null, + "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": 88, - "lines": 22, + "score": 98, + "lines": 13, "gotos": 0, - "casts": 1, - "unkGlue": 1, + "casts": 3, + "unkGlue": 0, "rawMem": 0, "addrDeref": 0 - }, - "errorMarkers": [ - "contract: structuring emitted ill-typed C in 'func_80014440_15040': interior pointer arithmetic on the global address '&gDefaultFontPalette'" - ] + } }, "m2c": { "decompiler": "m2c", @@ -12700,21 +13190,21 @@ }, "note": "src/10AD0.c: fills a font palette global; index 0 cleared, rest set to white", "gapSize": { - "decompiler": "m2c", - "score": 8, + "decompiler": "asmlift", + "score": 2, "maxScore": 14, - "ratio": 0.5714285714285714, + "ratio": 0.14285714285714285, "kinds": { "insert": 1, "delete": 1, - "replace": 1, + "replace": 0, "opMismatch": 0, - "argMismatch": 5 + "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -12733,11 +13223,12 @@ ], "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/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/15690.c#L304-L318", + "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, @@ -12795,7 +13286,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -12815,7 +13306,7 @@ ], "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/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/16FA0.c#L132-L147", + "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": { @@ -12826,6 +13317,7 @@ "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, @@ -12884,7 +13376,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -12904,7 +13396,7 @@ ], "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/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/199C0.c#L16-L29", + "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": { @@ -12915,6 +13407,7 @@ "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, @@ -12958,7 +13451,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -12979,7 +13472,7 @@ ], "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/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/1BBA0.c#L87-L106", + "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": { @@ -12989,6 +13482,7 @@ "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, @@ -13035,7 +13529,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -13054,7 +13548,7 @@ ], "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/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/1BBA0.c#L108-L117", + "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": { @@ -13064,6 +13558,7 @@ "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, @@ -13122,7 +13617,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -13141,7 +13636,7 @@ ], "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/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/227D0.c#L18-L26", + "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": { @@ -13152,6 +13647,7 @@ "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, @@ -13210,7 +13706,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -13229,7 +13725,7 @@ ], "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/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/22920.c#L35-L46", + "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": { @@ -13240,6 +13736,7 @@ "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, @@ -13298,7 +13795,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -13317,12 +13814,13 @@ ], "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/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/297B0.c#L42-L50", + "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, @@ -13368,7 +13866,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -13387,12 +13885,13 @@ ], "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/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/297B0.c#L123-L131", + "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, @@ -13438,7 +13937,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -13458,12 +13957,13 @@ ], "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/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/297B0.c#L862-L893", + "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, @@ -13521,7 +14021,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -13542,11 +14042,12 @@ ], "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/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/2AF90.c#L34-L82", + "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, @@ -13593,7 +14094,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -13613,11 +14114,12 @@ ], "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/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/2AF90.c#L88-L101", + "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, @@ -13663,7 +14165,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -13683,11 +14185,12 @@ ], "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/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/2AF90.c#L103-L162", + "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, @@ -13746,7 +14249,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -13765,11 +14268,14 @@ ], "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/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/2AF90.c#L168-L180", + "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, @@ -13832,7 +14338,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -13852,7 +14358,7 @@ ], "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/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/2C8F0.c#L47-L53", + "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": { @@ -13862,6 +14368,7 @@ "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, @@ -13907,7 +14414,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -13927,12 +14434,13 @@ ], "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/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/36B80.c#L8-L14", + "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, @@ -13979,7 +14487,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -13998,22 +14506,30 @@ ], "loc": 3, "refSource": "s32 func_80037FE0_38BE0(u8 arg0) {\n return EepromSaveData->save_slot_status[arg0] == 1;\n}", - "sourceUrl": "https://github.com/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/38BE0.c#L4-L6", + "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", - "outcome": "nonmatch", - "source": "u32 func_80037FE0_38BE0(u32 a0) {\n return (((u8 *)(EepromSaveData + (a0 & 255)))[16] ^ 1) < 1;\n}\n", - "score": 9, - "maxScore": 13, + "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": 5, + "insert": 0, "delete": 0, - "replace": 1, + "replace": 0, "opMismatch": 0, - "argMismatch": 3 + "argMismatch": 0 }, "quality": { "score": 100, @@ -14048,22 +14564,10 @@ ] }, "note": "src/38BE0.c: save-slot-in-use predicate; leaf", - "gapSize": { - "decompiler": "asmlift", - "score": 9, - "maxScore": 13, - "ratio": 0.6923076923076923, - "kinds": { - "insert": 5, - "delete": 0, - "replace": 1, - "opMismatch": 0, - "argMismatch": 3 - } - }, + "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -14083,13 +14587,21 @@ ], "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/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/38BE0.c#L8-L20", + "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 = ((u8 *)EepromSaveData)[78];\n break;\n case 7:\n v0 = ((u8 *)EepromSaveData)[79];\n break;\n default:\n v0 = ((u8 *)EepromSaveData)[80];\n }\n }\n return v0;\n}\n", + "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, @@ -14101,10 +14613,10 @@ "argMismatch": 2 }, "quality": { - "score": 94, + "score": 96, "lines": 18, "gotos": 0, - "casts": 3, + "casts": 0, "unkGlue": 0, "rawMem": 0, "addrDeref": 0 @@ -14150,7 +14662,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -14169,11 +14681,12 @@ ], "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/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/52880.c#L137-L158", + "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, @@ -14219,7 +14732,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -14239,11 +14752,14 @@ ], "loc": 3, "refSource": "s32 func_800B0DC0_1DCF60(TableHeader *table) {\n return *(s32 *)(table->countOffset + (s32)table);\n}", - "sourceUrl": "https://github.com/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/1DCF60.c#L14-L16", + "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, @@ -14302,7 +14818,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -14320,12 +14836,13 @@ ], "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/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/1E1BA0.c#L40-L50", + "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, @@ -14383,7 +14900,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -14400,11 +14917,14 @@ ], "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/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/1E2BE0.c#L21-L53", + "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, @@ -14454,7 +14974,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -14471,11 +14991,14 @@ ], "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/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/1E36C0.c#L134-L141", + "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, @@ -14525,7 +15048,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -14545,11 +15068,12 @@ ], "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/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/1E36C0.c#L576-L606", + "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, @@ -14595,7 +15119,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -14614,11 +15138,12 @@ ], "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/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/1E36C0.c#L608-L622", + "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, @@ -14664,7 +15189,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -14682,11 +15207,12 @@ ], "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/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/1E64A0.c#L16-L30", + "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, @@ -14732,7 +15258,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -14750,11 +15276,12 @@ ], "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/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/1E64A0.c#L201-L205", + "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, @@ -14798,7 +15325,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -14818,7 +15345,7 @@ ], "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/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/198B0.c#L10-L18", + "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": { @@ -14829,6 +15356,7 @@ "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, @@ -14875,7 +15403,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -14895,7 +15423,7 @@ ], "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/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/19E80.c#L3-L17", + "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": { @@ -14905,6 +15433,9 @@ "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, @@ -14967,7 +15498,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -14987,7 +15518,7 @@ ], "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/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/76B0.c#L30-L36", + "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": { @@ -14998,6 +15529,7 @@ "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, @@ -15044,7 +15576,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -15065,7 +15597,7 @@ ], "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/cdlewis/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/3B80.c#L80-L101", + "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": { @@ -15076,6 +15608,7 @@ "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, @@ -15134,7 +15667,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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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: 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" } }, { @@ -15155,6 +15688,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\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, @@ -15204,7 +15738,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -15226,6 +15760,7 @@ "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, @@ -15275,7 +15810,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -15297,6 +15832,7 @@ "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, @@ -15358,7 +15894,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -15380,6 +15916,7 @@ "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, @@ -15429,7 +15966,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -15450,6 +15987,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\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, @@ -15499,7 +16037,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -15566,7 +16104,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -15588,6 +16126,7 @@ "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, @@ -15649,7 +16188,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -15671,6 +16210,7 @@ "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, @@ -15720,7 +16260,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -15740,6 +16280,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\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, @@ -15789,7 +16330,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -15810,6 +16351,7 @@ "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, @@ -15859,7 +16401,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -15880,6 +16422,7 @@ "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, @@ -15929,7 +16472,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -15950,6 +16493,7 @@ "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, @@ -15999,7 +16543,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -16021,6 +16565,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\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, @@ -16070,7 +16615,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -16093,6 +16638,7 @@ "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, @@ -16142,7 +16688,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -16165,6 +16711,7 @@ "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, @@ -16226,7 +16773,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -16249,6 +16796,7 @@ "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, @@ -16298,7 +16846,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -16320,6 +16868,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\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, @@ -16365,7 +16914,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -16388,6 +16937,7 @@ "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, @@ -16433,7 +16983,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -16456,6 +17006,7 @@ "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, @@ -16501,7 +17052,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -16524,6 +17075,7 @@ "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, @@ -16570,7 +17122,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -16593,6 +17145,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\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\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 if (0 >= 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, @@ -16654,7 +17207,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -16678,6 +17231,7 @@ "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, @@ -16739,7 +17293,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -16808,7 +17362,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -16832,6 +17386,7 @@ "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, @@ -16893,7 +17448,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -16921,6 +17476,7 @@ }, "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, @@ -16970,7 +17526,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -16999,6 +17555,7 @@ "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, @@ -17048,7 +17605,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -17077,6 +17634,7 @@ "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, @@ -17126,7 +17684,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -17155,6 +17713,7 @@ "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, @@ -17204,7 +17763,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -17225,6 +17784,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\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, @@ -17274,7 +17834,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -17296,6 +17856,7 @@ "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, @@ -17345,7 +17906,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -17367,6 +17928,7 @@ "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, @@ -17416,7 +17978,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -17438,6 +18000,7 @@ "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, @@ -17499,7 +18062,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -17519,6 +18082,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\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, @@ -17568,7 +18132,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -17589,6 +18153,7 @@ "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, @@ -17638,7 +18203,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -17659,6 +18224,7 @@ "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, @@ -17708,7 +18274,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -17729,6 +18295,7 @@ "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, @@ -17778,7 +18345,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -17800,6 +18367,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\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, @@ -17849,7 +18417,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -17872,6 +18440,7 @@ "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, @@ -17921,7 +18490,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -17944,6 +18513,7 @@ "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, @@ -17993,7 +18563,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -18016,6 +18586,7 @@ "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, @@ -18065,7 +18636,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -18085,6 +18656,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\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, @@ -18134,7 +18706,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -18155,6 +18727,7 @@ "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, @@ -18204,7 +18777,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -18225,6 +18798,7 @@ "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, @@ -18274,7 +18848,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -18295,6 +18869,7 @@ "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, @@ -18344,7 +18919,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -18364,6 +18939,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\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, @@ -18413,7 +18989,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -18434,6 +19010,7 @@ "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, @@ -18483,7 +19060,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -18504,6 +19081,7 @@ "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, @@ -18553,7 +19131,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -18574,6 +19152,7 @@ "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, @@ -18623,7 +19202,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -18703,7 +19282,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -18727,6 +19306,7 @@ "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, @@ -18788,7 +19368,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -18812,6 +19392,7 @@ "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, @@ -18873,7 +19454,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -18897,6 +19478,7 @@ "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, @@ -18958,7 +19540,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -18978,6 +19560,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\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, @@ -19027,7 +19610,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -19048,6 +19631,7 @@ "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, @@ -19097,7 +19681,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -19118,6 +19702,7 @@ "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, @@ -19167,7 +19752,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -19188,6 +19773,7 @@ "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, @@ -19237,7 +19823,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -19259,6 +19845,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\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, @@ -19304,7 +19891,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -19327,6 +19914,7 @@ "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, @@ -19372,7 +19960,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -19395,6 +19983,7 @@ "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, @@ -19440,7 +20029,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -19463,6 +20052,7 @@ "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, @@ -19509,7 +20099,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -19535,6 +20125,7 @@ }, "asmlift": { "decompiler": "asmlift", + "candidateLabel": "unsigned", "outcome": "match", "source": "s32 call1(u32 a0) {\n return helper(a0) + 1;\n}\n", "score": 0, @@ -19584,7 +20175,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -19656,7 +20247,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -19683,6 +20274,7 @@ "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, @@ -19732,7 +20324,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -19759,6 +20351,7 @@ }, "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, @@ -19808,7 +20401,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -19881,7 +20474,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -19909,6 +20502,7 @@ "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, @@ -19958,7 +20552,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -19979,6 +20573,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\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, @@ -20028,7 +20623,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -20050,6 +20645,7 @@ "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, @@ -20099,7 +20695,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -20121,6 +20717,7 @@ "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, @@ -20170,7 +20767,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -20192,6 +20789,7 @@ "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, @@ -20241,7 +20839,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -20263,6 +20861,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\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, @@ -20312,7 +20911,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -20380,7 +20979,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -20460,7 +21059,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -20483,6 +21082,7 @@ "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, @@ -20532,7 +21132,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -20554,6 +21154,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\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, @@ -20603,7 +21204,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -20626,6 +21227,7 @@ "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, @@ -20687,7 +21289,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -20710,6 +21312,7 @@ "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, @@ -20759,7 +21362,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -20782,6 +21385,7 @@ "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, @@ -20831,7 +21435,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -20852,6 +21456,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\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\n", "asmlift": { "decompiler": "asmlift", + "candidateLabel": "unsigned", "outcome": "match", "source": "s32 clearbit(u32 a0, u32 a1) {\n return a0 & ~(1 << a1);\n}\n", "score": 0, @@ -20901,7 +21506,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `clearbit` — benchmark function synthetic:clearbit:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -20923,6 +21528,7 @@ "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, @@ -20972,7 +21578,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -20994,6 +21600,7 @@ "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, @@ -21043,7 +21650,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -21065,6 +21672,7 @@ "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, @@ -21114,7 +21722,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -21137,6 +21745,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\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\n", "asmlift": { "decompiler": "asmlift", + "candidateLabel": "unsigned", "outcome": "nonmatch", "source": "s32 continueloop(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, @@ -21198,7 +21807,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -21279,7 +21888,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -21348,7 +21957,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -21372,6 +21981,7 @@ "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, @@ -21433,7 +22043,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -21454,6 +22064,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\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, @@ -21503,7 +22114,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -21525,6 +22136,7 @@ "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, @@ -21574,7 +22186,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -21596,6 +22208,7 @@ "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, @@ -21645,7 +22258,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -21667,6 +22280,7 @@ "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, @@ -21728,7 +22342,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -21757,6 +22371,7 @@ "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, @@ -21803,7 +22418,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -21825,6 +22440,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\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, @@ -21886,7 +22502,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -21909,6 +22525,7 @@ "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, @@ -21970,7 +22587,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -22038,7 +22655,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -22061,6 +22678,7 @@ "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, @@ -22122,7 +22740,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -22144,6 +22762,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\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, @@ -22201,7 +22820,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -22269,7 +22888,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -22337,7 +22956,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -22405,7 +23024,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -22426,6 +23045,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\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, @@ -22475,7 +23095,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -22497,6 +23117,7 @@ "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, @@ -22546,7 +23167,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -22568,6 +23189,7 @@ "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, @@ -22617,7 +23239,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -22639,6 +23261,7 @@ "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, @@ -22688,7 +23311,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -22709,6 +23332,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\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, @@ -22758,7 +23382,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -22780,6 +23404,7 @@ "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, @@ -22829,7 +23454,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -22851,6 +23476,7 @@ "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, @@ -22900,7 +23526,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -22922,6 +23548,7 @@ "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, @@ -22983,7 +23610,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -23004,6 +23631,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, @@ -23053,7 +23681,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -23075,6 +23703,7 @@ "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, @@ -23124,7 +23753,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -23146,6 +23775,7 @@ "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, @@ -23195,7 +23825,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -23217,6 +23847,7 @@ "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, @@ -23266,7 +23897,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -23288,6 +23919,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\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, @@ -23337,7 +23969,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -23360,6 +23992,7 @@ "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, @@ -23409,7 +24042,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -23432,6 +24065,7 @@ "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, @@ -23481,7 +24115,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -23504,6 +24138,7 @@ "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, @@ -23553,7 +24188,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -23575,6 +24210,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\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, @@ -23624,7 +24260,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -23647,6 +24283,7 @@ "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, @@ -23696,7 +24333,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -23719,6 +24356,7 @@ "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, @@ -23768,7 +24406,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -23791,6 +24429,7 @@ "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, @@ -23840,7 +24479,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -23862,6 +24501,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\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, @@ -23911,7 +24551,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -23934,6 +24574,7 @@ "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, @@ -23983,7 +24624,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -24006,6 +24647,7 @@ "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, @@ -24055,7 +24697,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -24078,6 +24720,7 @@ "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, @@ -24127,7 +24770,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -24150,6 +24793,7 @@ "ctx": "int dotprod(int*,int*,int);", "asmlift": { "decompiler": "asmlift", + "candidateLabel": "unsigned", "outcome": "nonmatch", "source": "s32 dotprod(s32 * a0, s32 * a1, u32 a2) {\n s32 * v0;\n s32 * v1;\n s32 v2;\n s32 v3;\n if (0 >= 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, @@ -24211,7 +24855,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -24235,6 +24879,7 @@ "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, @@ -24296,7 +24941,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -24365,7 +25010,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -24430,7 +25075,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -24451,6 +25096,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\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, @@ -24500,7 +25146,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -24579,7 +25225,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -24658,7 +25304,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -24680,6 +25326,7 @@ "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, @@ -24729,7 +25376,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -24750,6 +25397,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\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, @@ -24799,7 +25447,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -24821,6 +25469,7 @@ "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, @@ -24870,7 +25519,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -24892,6 +25541,7 @@ "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, @@ -24941,7 +25591,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -24963,6 +25613,7 @@ "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, @@ -25024,7 +25675,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -25046,6 +25697,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\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, @@ -25095,7 +25747,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -25118,6 +25770,7 @@ "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, @@ -25167,7 +25820,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -25190,6 +25843,7 @@ "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, @@ -25239,7 +25893,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -25262,6 +25916,7 @@ "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, @@ -25311,7 +25966,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -25334,6 +25989,7 @@ "ctx": "int f2i(float);", "asmlift": { "decompiler": "asmlift", + "candidateLabel": "unsigned", "outcome": "match", "source": "s32 f2i(void) {\n return __fixsfsi();\n}\n", "score": 0, @@ -25383,7 +26039,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -25452,7 +26108,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -25521,7 +26177,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -25590,7 +26246,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -25612,6 +26268,7 @@ "ctx": "float fadd(float,float);", "asmlift": { "decompiler": "asmlift", + "candidateLabel": "unsigned", "outcome": "match", "source": "s32 fadd(void) {\n return __addsf3();\n}\n", "score": 0, @@ -25657,7 +26314,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -25725,7 +26382,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -25793,7 +26450,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -25861,7 +26518,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -25882,6 +26539,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\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, @@ -25931,7 +26589,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -25998,7 +26656,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -26077,7 +26735,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -26140,7 +26798,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -26162,6 +26820,7 @@ "ctx": "float fdiv(float,float);", "asmlift": { "decompiler": "asmlift", + "candidateLabel": "unsigned", "outcome": "match", "source": "s32 fdiv(void) {\n return __divsf3();\n}\n", "score": 0, @@ -26207,7 +26866,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -26275,7 +26934,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -26343,7 +27002,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -26411,7 +27070,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -26432,6 +27091,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\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\n", "asmlift": { "decompiler": "asmlift", + "candidateLabel": "unsigned", "outcome": "nonmatch", "source": "s32 fib(u32 a0) {\n s32 v0;\n s32 v1;\n s32 v2;\n s32 t0;\n if (0 >= 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, @@ -26493,7 +27153,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -26572,7 +27232,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -26651,7 +27311,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -26673,6 +27333,7 @@ "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, @@ -26734,7 +27395,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -26757,6 +27418,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\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\n", "asmlift": { "decompiler": "asmlift", + "candidateLabel": "unsigned", "outcome": "nonmatch", "source": "s32 findfirst(s32 * a0, u32 a1, u32 a2) {\n s32 * v0;\n s32 v1;\n if (0 < a1) {\n v0 = a0;\n v1 = 0;\n while (*v0 != a2) {\n v0 = v0 + 1;\n v1 = v1 + 1;\n if (v1 >= a1) return -1;\n }\n return v1;\n } else {\n return -1;\n }\n}\n", "score": 14, @@ -26818,7 +27480,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -26899,7 +27561,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -26968,7 +27630,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -26992,6 +27654,7 @@ "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, @@ -27053,7 +27716,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -27076,6 +27739,7 @@ "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, @@ -27133,7 +27797,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -27202,7 +27866,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -27271,7 +27935,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -27340,7 +28004,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -27362,6 +28026,7 @@ "ctx": "float fmul(float,float);", "asmlift": { "decompiler": "asmlift", + "candidateLabel": "unsigned", "outcome": "match", "source": "s32 fmul(void) {\n return __mulsf3();\n}\n", "score": 0, @@ -27407,7 +28072,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -27475,7 +28140,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -27543,7 +28208,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -27611,7 +28276,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -27633,6 +28298,7 @@ "ctx": "float fsub(float,float);", "asmlift": { "decompiler": "asmlift", + "candidateLabel": "unsigned", "outcome": "match", "source": "s32 fsub(void) {\n return __subsf3();\n}\n", "score": 0, @@ -27678,7 +28344,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -27746,7 +28412,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -27814,7 +28480,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -27882,7 +28548,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -27904,6 +28570,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\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, @@ -27953,7 +28620,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -27976,6 +28643,7 @@ "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, @@ -28025,7 +28693,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -28048,6 +28716,7 @@ "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, @@ -28109,7 +28778,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -28132,6 +28801,7 @@ "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, @@ -28193,7 +28863,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -28214,6 +28884,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\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, @@ -28263,7 +28934,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -28285,6 +28956,7 @@ "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, @@ -28334,7 +29006,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -28356,6 +29028,7 @@ "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, @@ -28405,7 +29078,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -28427,6 +29100,7 @@ "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, @@ -28476,7 +29150,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -28505,6 +29179,7 @@ }, "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, @@ -28554,7 +29229,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -28584,6 +29259,7 @@ "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, @@ -28633,7 +29309,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -28663,6 +29339,7 @@ "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, @@ -28712,7 +29389,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -28742,6 +29419,7 @@ "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, @@ -28791,7 +29469,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -28814,6 +29492,7 @@ "ctx": "float i2f(int);", "asmlift": { "decompiler": "asmlift", + "candidateLabel": "unsigned", "outcome": "match", "source": "s32 i2f(void) {\n return __floatsisf();\n}\n", "score": 0, @@ -28859,7 +29538,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -28928,7 +29607,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -28997,7 +29676,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -29066,7 +29745,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -29088,6 +29767,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\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, @@ -29149,7 +29829,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -29172,6 +29852,7 @@ "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, @@ -29233,7 +29914,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -29256,6 +29937,7 @@ "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, @@ -29317,7 +29999,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -29340,6 +30022,7 @@ "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, @@ -29401,7 +30084,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -29423,6 +30106,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\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, @@ -29472,7 +30156,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -29495,6 +30179,7 @@ "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, @@ -29544,7 +30229,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -29567,6 +30252,7 @@ "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, @@ -29628,7 +30314,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -29651,6 +30337,7 @@ "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, @@ -29700,7 +30387,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -29721,6 +30408,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\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, @@ -29770,7 +30458,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -29792,6 +30480,7 @@ "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, @@ -29841,7 +30530,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -29863,6 +30552,7 @@ "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, @@ -29912,7 +30602,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -29934,6 +30624,7 @@ "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, @@ -29983,7 +30674,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -30004,6 +30695,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\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, @@ -30053,7 +30745,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -30075,6 +30767,7 @@ "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, @@ -30124,7 +30817,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -30146,6 +30839,7 @@ "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, @@ -30207,7 +30901,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -30229,6 +30923,7 @@ "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, @@ -30290,7 +30985,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -30312,6 +31007,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\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, @@ -30361,7 +31057,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -30384,6 +31080,7 @@ "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, @@ -30445,7 +31142,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -30468,6 +31165,7 @@ "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, @@ -30529,7 +31227,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -30552,6 +31250,7 @@ "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, @@ -30613,7 +31312,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -30634,6 +31333,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\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, @@ -30695,7 +31395,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -30717,6 +31417,7 @@ "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, @@ -30778,7 +31479,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -30800,6 +31501,7 @@ "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, @@ -30861,7 +31563,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -30924,7 +31626,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -30945,6 +31647,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\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\n", "asmlift": { "decompiler": "asmlift", + "candidateLabel": "unsigned/flip-branch", "outcome": "nonmatch", "source": "s32 llcmp(u32 a0, u32 a1, u32 a2, u32 a3) {\n s32 v0;\n if (a3 > 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, @@ -30994,7 +31697,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -31016,6 +31719,7 @@ "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, @@ -31077,7 +31781,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -31099,6 +31803,7 @@ "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, @@ -31160,7 +31865,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -31225,7 +31930,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -31246,6 +31951,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\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\n", "asmlift": { "decompiler": "asmlift", + "candidateLabel": "unsigned", "outcome": "nonmatch", "source": "s32 llshl(void) {\n return __ashldi3();\n}\n", "score": 2, @@ -31303,7 +32009,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `llshl` — benchmark function synthetic:llshl:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -31325,6 +32031,7 @@ "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, @@ -31386,7 +32093,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -31449,7 +32156,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -31471,6 +32178,7 @@ "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, @@ -31516,7 +32224,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -31538,6 +32246,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\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, @@ -31595,7 +32304,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -31618,6 +32327,7 @@ "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, @@ -31679,7 +32389,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -31743,7 +32453,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -31766,6 +32476,7 @@ "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, @@ -31811,7 +32522,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -31832,6 +32543,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\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, @@ -31893,7 +32605,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -31915,6 +32627,7 @@ "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, @@ -31976,7 +32689,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -31998,6 +32711,7 @@ "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, @@ -32059,7 +32773,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -32122,7 +32836,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -32144,6 +32858,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\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, @@ -32190,7 +32905,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -32213,6 +32928,7 @@ "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, @@ -32258,7 +32974,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -32281,6 +32997,7 @@ "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, @@ -32326,7 +33043,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -32349,6 +33066,7 @@ "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, @@ -32395,7 +33113,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -32417,6 +33135,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\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, @@ -32478,7 +33197,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -32558,7 +33277,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -32626,7 +33345,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -32649,6 +33368,7 @@ "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, @@ -32710,7 +33430,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -32731,6 +33451,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\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, @@ -32780,7 +33501,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -32802,6 +33523,7 @@ "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, @@ -32851,7 +33573,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -32873,6 +33595,7 @@ "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, @@ -32934,7 +33657,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -32956,6 +33679,7 @@ "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, @@ -33017,7 +33741,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -33038,6 +33762,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\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, @@ -33087,7 +33812,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -33109,6 +33834,7 @@ "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, @@ -33158,7 +33884,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -33180,6 +33906,7 @@ "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, @@ -33229,7 +33956,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -33251,6 +33978,7 @@ "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, @@ -33300,7 +34028,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -33321,6 +34049,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\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, @@ -33370,7 +34099,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -33437,7 +34166,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -33459,6 +34188,7 @@ "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, @@ -33520,7 +34250,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -33542,6 +34272,7 @@ "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, @@ -33591,7 +34322,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -33613,6 +34344,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\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, @@ -33674,7 +34406,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -33754,7 +34486,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -33822,7 +34554,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -33845,6 +34577,7 @@ "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, @@ -33906,7 +34639,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -33927,6 +34660,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\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, @@ -33976,7 +34710,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -34043,7 +34777,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -34065,6 +34799,7 @@ "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, @@ -34126,7 +34861,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -34148,6 +34883,7 @@ "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, @@ -34197,7 +34933,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -34283,7 +35019,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -34313,6 +35049,7 @@ "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, @@ -34374,7 +35111,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -34449,7 +35186,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -34479,6 +35216,7 @@ "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, @@ -34538,7 +35276,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -34624,7 +35362,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -34711,7 +35449,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -34785,7 +35523,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -34815,6 +35553,7 @@ "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, @@ -34873,7 +35612,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -34895,6 +35634,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\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, @@ -34956,7 +35696,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -34979,6 +35719,7 @@ "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, @@ -35028,7 +35769,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -35051,6 +35792,7 @@ "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, @@ -35100,7 +35842,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -35180,7 +35922,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -35201,6 +35943,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\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\n", "asmlift": { "decompiler": "asmlift", + "candidateLabel": "signed", "outcome": "match", "source": "s32 mini(s32 a0, s32 a1) {\n if (a1 > a0) a1 = a0;\n return a1;\n}\n", "score": 0, @@ -35250,7 +35993,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -35317,7 +36060,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -35339,6 +36082,7 @@ "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, @@ -35400,7 +36144,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -35422,6 +36166,7 @@ "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, @@ -35471,7 +36216,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -35492,6 +36237,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\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, @@ -35541,7 +36287,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -35563,6 +36309,7 @@ "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, @@ -35612,7 +36359,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -35634,6 +36381,7 @@ "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, @@ -35683,7 +36431,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -35705,6 +36453,7 @@ "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, @@ -35754,7 +36503,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -35775,6 +36524,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\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, @@ -35824,7 +36574,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -35846,6 +36596,7 @@ "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, @@ -35895,7 +36646,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -35917,6 +36668,7 @@ "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, @@ -35966,7 +36718,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -35988,6 +36740,7 @@ "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, @@ -36049,7 +36802,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -36071,6 +36824,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\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, @@ -36120,7 +36874,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -36143,6 +36897,7 @@ "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, @@ -36192,7 +36947,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -36215,6 +36970,7 @@ "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, @@ -36264,7 +37020,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -36287,6 +37043,7 @@ "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, @@ -36336,7 +37093,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -36356,6 +37113,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\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, @@ -36405,7 +37163,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -36426,6 +37184,7 @@ "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, @@ -36475,7 +37234,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -36496,6 +37255,7 @@ "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, @@ -36545,7 +37305,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -36566,6 +37326,7 @@ "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, @@ -36615,7 +37376,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -36636,6 +37397,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\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, @@ -36685,7 +37447,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -36707,6 +37469,7 @@ "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, @@ -36756,7 +37519,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -36778,6 +37541,7 @@ "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, @@ -36827,7 +37591,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -36849,6 +37613,7 @@ "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, @@ -36898,7 +37663,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -36927,6 +37692,7 @@ }, "asmlift": { "decompiler": "asmlift", + "candidateLabel": "unsigned", "outcome": "match", "source": "void narrow(u8 * a0, u32 a1) {\n *a0 = a1;\n return;\n}\n", "score": 0, @@ -36976,7 +37742,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -37006,6 +37772,7 @@ "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, @@ -37055,7 +37822,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -37085,6 +37852,7 @@ "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, @@ -37134,7 +37902,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -37164,6 +37932,7 @@ "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, @@ -37213,7 +37982,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -37233,6 +38002,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\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, @@ -37282,7 +38052,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -37303,6 +38073,7 @@ "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, @@ -37352,7 +38123,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -37373,6 +38144,7 @@ "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, @@ -37422,7 +38194,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -37443,6 +38215,7 @@ "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, @@ -37492,7 +38265,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -37513,6 +38286,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\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, @@ -37562,7 +38336,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -37641,7 +38415,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -37663,6 +38437,7 @@ "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, @@ -37712,7 +38487,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -37734,6 +38509,7 @@ "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, @@ -37783,7 +38559,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -37805,6 +38581,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\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\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 if (0 >= 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, @@ -37866,7 +38643,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -37889,6 +38666,7 @@ "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, @@ -37950,7 +38728,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -38030,7 +38808,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -38053,6 +38831,7 @@ "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, @@ -38114,7 +38893,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -38135,6 +38914,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\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, @@ -38184,7 +38964,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -38206,6 +38986,7 @@ "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, @@ -38255,7 +39036,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -38277,6 +39058,7 @@ "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, @@ -38326,7 +39108,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -38348,6 +39130,7 @@ "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, @@ -38397,7 +39180,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -38419,6 +39202,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\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\n", "asmlift": { "decompiler": "asmlift", + "candidateLabel": "unsigned", "outcome": "nonmatch", "source": "s32 powi(u32 a0, u32 a1) {\n s32 v0;\n s32 v1;\n v1 = a1;\n v0 = 1;\n while (v1 != 0) {\n v0 = v0 * a0;\n v1 = v1 - 1;\n }\n return v0;\n}\n", "score": 1, @@ -38480,7 +39264,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -38560,7 +39344,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -38640,7 +39424,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -38663,6 +39447,7 @@ "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, @@ -38724,7 +39509,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -38746,6 +39531,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\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, @@ -38795,7 +39581,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -38818,6 +39604,7 @@ "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, @@ -38867,7 +39654,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -38890,6 +39677,7 @@ "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, @@ -38939,7 +39727,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -38962,6 +39750,7 @@ "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, @@ -39011,7 +39800,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -39032,6 +39821,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\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, @@ -39081,7 +39871,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -39103,6 +39893,7 @@ "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, @@ -39152,7 +39943,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -39174,6 +39965,7 @@ "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, @@ -39223,7 +40015,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -39245,6 +40037,7 @@ "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, @@ -39294,7 +40087,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -39322,6 +40115,7 @@ }, "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 s32 v5;\n if (0 < a1 - 1) {\n v2 = a0;\n v4 = 0;\n v5 = a1 - 1;\n v3 = (a1 - 1 << 2) + a0;\n do {\n v0 = *v2;\n v1 = (s32 *)*v3;\n *v2 = v1;\n *v3 = v0;\n v2 = v2 + 1;\n v4 = v4 + 1;\n v3 = v3 - 1;\n v5 = v5 - 1;\n } while (v4 < v5);\n a0 = v1;\n }\n return;\n}\n", "score": 6, @@ -39383,7 +40177,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -39412,6 +40206,7 @@ "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, @@ -39473,7 +40268,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -39502,6 +40297,7 @@ "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, @@ -39559,7 +40355,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -39588,6 +40384,7 @@ "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, @@ -39649,7 +40446,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -39671,6 +40468,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\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, @@ -39720,7 +40518,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -39743,6 +40541,7 @@ "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, @@ -39792,7 +40591,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -39815,6 +40614,7 @@ "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, @@ -39864,7 +40664,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -39887,6 +40687,7 @@ "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, @@ -39932,7 +40733,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -39955,6 +40756,7 @@ "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, @@ -40016,7 +40818,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -40040,6 +40842,7 @@ "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, @@ -40089,7 +40892,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -40113,6 +40916,7 @@ "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, @@ -40162,7 +40966,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -40186,6 +40990,7 @@ "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, @@ -40231,7 +41036,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -40253,6 +41058,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\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, @@ -40302,7 +41108,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -40325,6 +41131,7 @@ "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, @@ -40374,7 +41181,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -40397,6 +41204,7 @@ "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, @@ -40458,7 +41266,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -40481,6 +41289,7 @@ "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, @@ -40530,7 +41339,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -40551,6 +41360,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\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\n", "asmlift": { "decompiler": "asmlift", + "candidateLabel": "unsigned", "outcome": "match", "source": "s32 setbit(u32 a0, u32 a1) {\n return 1 << a1 | a0;\n}\n", "score": 0, @@ -40600,7 +41410,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `setbit` — benchmark function synthetic:setbit:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -40622,6 +41432,7 @@ "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, @@ -40671,7 +41482,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -40693,6 +41504,7 @@ "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, @@ -40742,7 +41554,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -40764,6 +41576,7 @@ "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, @@ -40813,7 +41626,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -40841,6 +41654,7 @@ }, "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, @@ -40890,7 +41704,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -40919,6 +41733,7 @@ "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, @@ -40965,7 +41780,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -40994,6 +41809,7 @@ "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, @@ -41042,7 +41858,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -41071,6 +41887,7 @@ "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, @@ -41117,7 +41934,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -41138,6 +41955,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\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, @@ -41187,7 +42005,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -41209,6 +42027,7 @@ "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, @@ -41258,7 +42077,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -41280,6 +42099,7 @@ "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, @@ -41329,7 +42149,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -41351,6 +42171,7 @@ "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, @@ -41400,7 +42221,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -41421,6 +42242,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\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, @@ -41467,7 +42289,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -41489,6 +42311,7 @@ "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, @@ -41534,7 +42357,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -41556,6 +42379,7 @@ "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, @@ -41601,7 +42425,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -41623,6 +42447,7 @@ "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, @@ -41669,7 +42494,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -41690,6 +42515,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\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\n", "asmlift": { "decompiler": "asmlift", + "candidateLabel": "unsigned", "outcome": "match", "source": "s32 shl(u32 a0, u32 a1) {\n return a0 << a1;\n}\n", "score": 0, @@ -41739,7 +42565,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `shl` — benchmark function synthetic:shl:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -41761,6 +42587,7 @@ "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, @@ -41810,7 +42637,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -41832,6 +42659,7 @@ "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, @@ -41881,7 +42709,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -41903,6 +42731,7 @@ "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, @@ -41952,7 +42781,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -41974,6 +42803,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\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, @@ -42023,7 +42853,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -42046,6 +42876,7 @@ "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, @@ -42095,7 +42926,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -42118,6 +42949,7 @@ "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, @@ -42167,7 +42999,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -42190,6 +43022,7 @@ "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, @@ -42239,7 +43072,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -42260,6 +43093,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\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, @@ -42309,7 +43143,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -42331,6 +43165,7 @@ "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, @@ -42380,7 +43215,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -42402,6 +43237,7 @@ "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, @@ -42451,7 +43287,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -42473,6 +43309,7 @@ "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, @@ -42522,7 +43359,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -42544,6 +43381,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\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, @@ -42605,7 +43443,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -42628,6 +43466,7 @@ "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, @@ -42677,7 +43516,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -42700,6 +43539,7 @@ "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, @@ -42749,7 +43589,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -42772,6 +43612,7 @@ "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, @@ -42833,7 +43674,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -42854,6 +43695,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\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, @@ -42903,7 +43745,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -42925,6 +43767,7 @@ "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, @@ -42986,7 +43829,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -43008,6 +43851,7 @@ "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, @@ -43057,7 +43901,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -43079,6 +43923,7 @@ "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, @@ -43128,7 +43973,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -43150,8 +43995,9 @@ "targetAsm": "@ Generated by gcc 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": "struct Struct0 { s16 field_0; s32 field_4; };\ns32 smixed(struct Struct0 * a0) {\n return a0->field_0 + a0->field_4;\n}\n", + "source": "s32 smixed(s32 * a0) {\n return *(s16 *)(a0 + 2) + a0[1];\n}\n", "score": 1, "maxScore": 6, "compileErrors": null, @@ -43163,12 +44009,12 @@ "argMismatch": 1 }, "quality": { - "score": 100, - "lines": 4, + "score": 96, + "lines": 3, "gotos": 0, - "casts": 0, + "casts": 1, "unkGlue": 0, - "rawMem": 0, + "rawMem": 1, "addrDeref": 0 } }, @@ -43209,7 +44055,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -43232,6 +44078,7 @@ "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, @@ -43278,7 +44125,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -43301,6 +44148,7 @@ "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, @@ -43346,7 +44194,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -43369,6 +44217,7 @@ "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, @@ -43415,7 +44264,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -43443,6 +44292,7 @@ }, "asmlift": { "decompiler": "asmlift", + "candidateLabel": "unsigned", "outcome": "match", "source": "void sstore(s32 * a0, u32 a1) {\n a0[1] = a1;\n return;\n}\n", "score": 0, @@ -43491,7 +44341,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -43520,6 +44370,7 @@ "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, @@ -43565,7 +44416,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -43594,6 +44445,7 @@ "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, @@ -43640,7 +44492,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -43669,6 +44521,7 @@ "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, @@ -43715,7 +44568,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -43742,6 +44595,7 @@ }, "asmlift": { "decompiler": "asmlift", + "candidateLabel": "unsigned", "outcome": "match", "source": "void storep(s32 * a0, u32 a1) {\n *a0 = a1;\n return;\n}\n", "score": 0, @@ -43791,7 +44645,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -43819,6 +44673,7 @@ "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, @@ -43868,7 +44723,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -43896,6 +44751,7 @@ "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, @@ -43945,7 +44801,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -43973,6 +44829,7 @@ "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, @@ -44022,7 +44879,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -44102,7 +44959,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -44171,7 +45028,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -44236,7 +45093,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -44317,7 +45174,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -44340,6 +45197,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\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, @@ -44389,7 +45247,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -44413,6 +45271,7 @@ "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, @@ -44462,7 +45321,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -44527,7 +45386,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -44551,6 +45410,7 @@ "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, @@ -44600,7 +45460,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -44623,6 +45483,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\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\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 if (0 >= 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, @@ -44684,7 +45545,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -44708,6 +45569,7 @@ "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, @@ -44769,7 +45631,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -44838,7 +45700,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -44862,6 +45724,7 @@ "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, @@ -44923,7 +45786,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -44943,6 +45806,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\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, @@ -44992,7 +45856,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -45013,6 +45877,7 @@ "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, @@ -45062,7 +45927,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -45083,6 +45948,7 @@ "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, @@ -45132,7 +45998,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -45153,6 +46019,7 @@ "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, @@ -45202,7 +46069,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -45223,6 +46090,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\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\n", "asmlift": { "decompiler": "asmlift", + "candidateLabel": "signed", "outcome": "match", "source": "s32 sumto(s32 a0) {\n s32 v0;\n s32 v1;\n v1 = 0;\n for (v0 = 0; v0 < a0; v0 = v0 + 1) {\n v1 = v1 + v0;\n }\n return v1;\n}\n", "score": 0, @@ -45272,7 +46140,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -45351,7 +46219,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -45430,7 +46298,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -45452,6 +46320,7 @@ "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, @@ -45513,7 +46382,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -45534,6 +46403,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\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, @@ -45583,7 +46453,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -45650,7 +46520,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -45672,6 +46542,7 @@ "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, @@ -45721,7 +46592,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -45788,7 +46659,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -45810,6 +46681,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\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, @@ -45859,7 +46731,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -45882,6 +46754,7 @@ "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, @@ -45931,7 +46804,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -45954,6 +46827,7 @@ "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, @@ -46003,7 +46877,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -46026,6 +46900,7 @@ "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, @@ -46075,7 +46950,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -46097,6 +46972,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\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, @@ -46146,7 +47022,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -46226,7 +47102,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -46249,6 +47125,7 @@ "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, @@ -46298,7 +47175,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -46366,7 +47243,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -46387,6 +47264,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\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, @@ -46436,7 +47314,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -46515,7 +47393,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -46537,6 +47415,7 @@ "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, @@ -46586,7 +47465,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -46653,7 +47532,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -46674,6 +47553,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\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, @@ -46723,7 +47603,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -46745,6 +47625,7 @@ "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, @@ -46806,7 +47687,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -46828,6 +47709,7 @@ "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, @@ -46877,7 +47759,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -46944,7 +47826,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -46972,6 +47854,7 @@ }, "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, @@ -47021,7 +47904,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -47050,6 +47933,7 @@ "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, @@ -47099,7 +47983,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -47128,6 +48012,7 @@ "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, @@ -47177,7 +48062,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -47251,7 +48136,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -47279,6 +48164,7 @@ }, "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, @@ -47328,7 +48214,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -47357,6 +48243,7 @@ "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, @@ -47406,7 +48293,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -47435,6 +48322,7 @@ "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, @@ -47484,7 +48372,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -47513,6 +48401,7 @@ "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, @@ -47562,7 +48451,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -47583,6 +48472,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\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\n", "asmlift": { "decompiler": "asmlift", + "candidateLabel": "unsigned", "outcome": "match", "source": "s32 togglebit(u32 a0, u32 a1) {\n return 1 << a1 ^ a0;\n}\n", "score": 0, @@ -47632,7 +48522,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `togglebit` — benchmark function synthetic:togglebit:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -47654,6 +48544,7 @@ "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, @@ -47703,7 +48594,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -47725,6 +48616,7 @@ "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, @@ -47774,7 +48666,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -47796,6 +48688,7 @@ "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, @@ -47845,7 +48738,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -47867,6 +48760,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\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, @@ -47916,7 +48810,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -47939,6 +48833,7 @@ "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, @@ -47988,7 +48883,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -48011,6 +48906,7 @@ "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, @@ -48060,7 +48956,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -48083,6 +48979,7 @@ "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, @@ -48132,7 +49029,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -48153,6 +49050,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\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, @@ -48202,7 +49100,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -48224,6 +49122,7 @@ "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, @@ -48273,7 +49172,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -48295,6 +49194,7 @@ "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, @@ -48344,7 +49244,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -48366,6 +49266,7 @@ "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, @@ -48415,7 +49316,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -48436,6 +49337,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\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, @@ -48485,7 +49387,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -48507,6 +49409,7 @@ "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, @@ -48556,7 +49459,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -48578,6 +49481,7 @@ "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, @@ -48627,7 +49531,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -48649,6 +49553,7 @@ "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, @@ -48698,7 +49603,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -48720,6 +49625,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\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, @@ -48769,7 +49675,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -48792,6 +49698,7 @@ "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, @@ -48841,7 +49748,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -48864,6 +49771,7 @@ "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, @@ -48913,7 +49821,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -48936,6 +49844,7 @@ "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, @@ -48985,7 +49894,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -49006,6 +49915,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, @@ -49055,7 +49965,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -49077,6 +49987,7 @@ "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, @@ -49126,7 +50037,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -49148,6 +50059,7 @@ "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, @@ -49197,7 +50109,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -49219,6 +50131,7 @@ "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, @@ -49268,7 +50181,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -49290,6 +50203,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\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, @@ -49339,7 +50253,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -49362,6 +50276,7 @@ "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, @@ -49411,7 +50326,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -49434,6 +50349,7 @@ "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, @@ -49483,7 +50399,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -49506,6 +50422,7 @@ "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, @@ -49555,7 +50472,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -49577,6 +50494,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\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, @@ -49626,7 +50544,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -49649,6 +50567,7 @@ "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, @@ -49698,7 +50617,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -49721,6 +50640,7 @@ "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, @@ -49770,7 +50690,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -49793,6 +50713,7 @@ "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, @@ -49842,7 +50763,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -49864,6 +50785,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\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, @@ -49913,7 +50835,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -49936,6 +50858,7 @@ "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, @@ -49985,7 +50908,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -50008,6 +50931,7 @@ "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, @@ -50057,7 +50981,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -50080,6 +51004,7 @@ "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, @@ -50129,7 +51054,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -50152,6 +51077,7 @@ "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, @@ -50199,7 +51125,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -50230,6 +51156,7 @@ }, "asmlift": { "decompiler": "asmlift", + "candidateLabel": "unsigned", "outcome": "match", "source": "void voidcall(u32 a0) {\n sink(a0);\n return;\n}\n", "score": 0, @@ -50279,7 +51206,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -50356,7 +51283,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -50388,6 +51315,7 @@ "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, @@ -50437,7 +51365,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -50458,6 +51386,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\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, @@ -50507,7 +51436,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -50529,6 +51458,7 @@ "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, @@ -50578,7 +51508,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -50600,6 +51530,7 @@ "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, @@ -50661,7 +51592,7 @@ }, "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } }, { @@ -50683,6 +51614,7 @@ "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, @@ -50732,7 +51664,7 @@ "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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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" + "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" } } ] diff --git a/apps/benchmark/src/cache.ts b/apps/benchmark/src/cache.ts index cc6d944b..c8f39dbb 100644 --- a/apps/benchmark/src/cache.ts +++ b/apps/benchmark/src/cache.ts @@ -141,13 +141,14 @@ export function cachedM2cResult(inputs: M2cKeyInputs, compute: () => DecompilerR if (!enabled() || !commit) { return compute(); } - // The objdump→GNU-as normalizer, the m2c scoring prelude and the outcome classifier all run - // INSIDE this cached computation but are not part of the key — any change to them MUST bump - // `v`, or fixed rows keep serving stale results. `lang` enters the key only for c++ so every - // existing C entry keeps its identity. + // The objdump→GNU-as normalizer, the m2c scoring prelude, the outcome classifier and the + // quality heuristic all run INSIDE this cached computation but are not part of the key — any + // change to them MUST bump `v`, or fixed rows keep serving stale results. `lang` enters the + // key only for c++ so every existing C entry keeps its identity. + // v13: assessQuality exempts project-idiom address casts from the casts count. const key = sha( JSON.stringify({ - v: 12, + v: 13, kind: 'm2c', commit, tc: tcId, diff --git a/apps/benchmark/src/cases/checkout.ts b/apps/benchmark/src/cases/checkout.ts new file mode 100644 index 00000000..ee007d73 --- /dev/null +++ b/apps/benchmark/src/cases/checkout.ts @@ -0,0 +1,165 @@ +// Checkout pinning for the real tier. Every real-project manifest names its GitHub fork +// (`repo`) and pinned integration branch (`branch` — provenance base + one integration +// commit); the vendored dataset is only reproducible when the local checkout sits on that +// branch's remote head. This module answers "where does the checkout stand?" (checkoutStatus) +// and enforces the pin for `bench vendor`/`bench fidelity` (enforceCheckoutPin). +// +// Enforcement policy: +// - HEAD == remote branch head, clean tree → ok +// - HEAD == remote branch head, DIRTY tree → warning (never an error: the maintainer's +// machine runs with WIP checkouts, and the current vendored data was produced that way) +// - HEAD != remote head / remote unreachable AND HEAD not a provenance descendant +// → loud error naming the remedy — unless ASMLIFT_ALLOW_DIRTY_CHECKOUT=1 downgrades it +// to a warning (the same WIP-machine escape hatch; CI and fresh setups stay strict) +// - offline (remote unreachable) fallback: accept a HEAD that DESCENDS from the vendored +// PROVENANCE commit, warning that remote verification was skipped. +import { execSync } from 'node:child_process'; +import { existsSync, readFileSync } from 'node:fs'; +import { join } from 'node:path'; + +import { REAL_DIR, type RealManifest, resolveProjectRoot } from './manifests'; + +/** Injectable remote-head lookup (tests stub this — no network in CI). */ +export type RemoteLookup = (repo: string, branch: string) => string | null; + +export interface CheckoutStatus { + project: string; + dir: string; + present: boolean; + /** absent when the dir exists but is not a git checkout */ + head?: string; + dirty?: boolean; + /** null ⇒ remote unreachable (offline) */ + remoteHead?: string | null; + /** offline-fallback evidence: HEAD descends from the vendored PROVENANCE commit */ + descendsFromProvenance?: boolean; +} + +const GIT_ENV = { ...process.env, GIT_TERMINAL_PROMPT: '0' }; + +export function git(dir: string, args: string): string { + return execSync(`git -C ${JSON.stringify(dir)} ${args}`, { encoding: 'utf8', env: GIT_ENV }).trim(); +} + +/** The fork's branch head via `git ls-remote`, or null when the remote is unreachable. */ +export function remoteBranchHead(repo: string, branch: string): string | null { + try { + const out = execSync(`git ls-remote https://github.com/${repo}.git refs/heads/${branch}`, { + encoding: 'utf8', + env: GIT_ENV, + timeout: 30_000, + }); + const sha = out.split('\t')[0]?.trim(); + return sha && /^[0-9a-f]{40}$/.test(sha) ? sha : null; + } catch { + return null; + } +} + +/** The commit the vendored dataset was produced at (dataset/real/tu/

/PROVENANCE.json). */ +export function provenanceCommit(project: string): string | null { + const p = join(REAL_DIR, 'tu', project, 'PROVENANCE.json'); + if (!existsSync(p)) { + return null; + } + try { + return (JSON.parse(readFileSync(p, 'utf8')) as { commit?: string }).commit ?? null; + } catch { + return null; + } +} + +/** Read-only: where the project checkout stands relative to its pinned branch. NEVER mutates + * the checkout (no fetch — the remote head comes from ls-remote against the fork). */ +export function checkoutStatus(man: RealManifest, lookupRemote: RemoteLookup = remoteBranchHead): CheckoutStatus { + const dir = resolveProjectRoot(man); + if (!existsSync(dir)) { + return { project: man.project, dir, present: false }; + } + if (!existsSync(join(dir, '.git'))) { + return { project: man.project, dir, present: true }; // present but not a git checkout + } + const head = git(dir, 'rev-parse HEAD'); + const dirty = git(dir, 'status --porcelain') !== ''; + const remoteHead = lookupRemote(man.repo, man.branch); + const st: CheckoutStatus = { project: man.project, dir, present: true, head, dirty, remoteHead }; + if (remoteHead === null) { + const prov = provenanceCommit(man.project); + if (prov) { + try { + execSync(`git -C ${JSON.stringify(dir)} merge-base --is-ancestor ${prov} HEAD`, { env: GIT_ENV }); + st.descendsFromProvenance = true; + } catch { + st.descendsFromProvenance = false; + } + } + } + return st; +} + +/** The WIP-checkout escape hatch: downgrades pin violations to warnings. */ +export function allowDirtyCheckout(): boolean { + return process.env.ASMLIFT_ALLOW_DIRTY_CHECKOUT === '1'; +} + +export interface EnforceOptions { + /** what a MISSING checkout means: 'error' (vendor — it needs the checkout anyway) or + * 'warn' (fidelity — CI runs it checkout-free by design and must stay green) */ + onMissing?: 'error' | 'warn'; + lookupRemote?: RemoteLookup; +} + +/** Enforce the branch pin for one project (see the policy at the top of this file). Returns + * the observed status so callers can gate follow-up checks on `present`/`head`. */ +export function enforceCheckoutPin(man: RealManifest, command: string, opts: EnforceOptions = {}): CheckoutStatus { + const st = checkoutStatus(man, opts.lookupRemote ?? remoteBranchHead); + const remedy = `git -C ${st.dir} fetch && git -C ${st.dir} checkout ${man.branch} (or \`pnpm bench setup\` for a fresh clone)`; + const violate = (msg: string): void => { + if (allowDirtyCheckout()) { + console.warn(`WARN ${command}: ${msg} — allowed by ASMLIFT_ALLOW_DIRTY_CHECKOUT=1`); + } else { + throw new Error( + `${command}: ${msg}\n remedy: ${remedy}\n (or set ASMLIFT_ALLOW_DIRTY_CHECKOUT=1 to proceed with a WIP checkout)`, + ); + } + }; + if (!st.present) { + const msg = `${man.project}: checkout missing at ${st.dir} — run \`pnpm bench setup\``; + if ((opts.onMissing ?? 'error') === 'error') { + throw new Error(`${command}: ${msg}`); + } + console.warn(`WARN ${command}: ${msg}`); + return st; + } + if (!st.head) { + violate(`${man.project}: ${st.dir} exists but is not a git checkout`); + return st; + } + const remoteHead = st.remoteHead ?? null; + if (remoteHead === null) { + if (st.descendsFromProvenance) { + console.warn( + `WARN ${command}: ${man.project}: remote unreachable — pin NOT verified against ` + + `${man.repo}#${man.branch}; HEAD descends from the vendored provenance base (accepted offline)`, + ); + } else { + violate( + `${man.project}: remote ${man.repo} unreachable AND HEAD ${st.head.slice(0, 7)} does not descend ` + + `from the vendored provenance base`, + ); + return st; + } + } else if (st.head !== remoteHead) { + violate( + `${man.project}: checkout HEAD ${st.head.slice(0, 7)} != ${man.repo}#${man.branch} head ${remoteHead.slice(0, 7)}`, + ); + return st; + } + if (st.dirty) { + console.warn( + `WARN ${command}: ${man.project}: working tree at ${st.dir} is DIRTY — results may not be ` + + `reproducible from ${man.repo}#${man.branch}`, + ); + } + return st; +} diff --git a/apps/benchmark/src/cases/manifests.ts b/apps/benchmark/src/cases/manifests.ts index afab56c4..f5cf15de 100644 --- a/apps/benchmark/src/cases/manifests.ts +++ b/apps/benchmark/src/cases/manifests.ts @@ -4,12 +4,14 @@ // `bench verify` loop; consumed by the real case provider. // // PORTABILITY: manifests carry NO absolute paths — the project root is a workspace-relative -// directory name (`repoDir`) resolved against the sibling-checkout WORKSPACE convention, -// overridable per project via ASMLIFT_PROJ_ (uppercased, non-alphanumerics → _). +// directory name (`repoDir`), resolved in order: ASMLIFT_PROJ_ env override +// (uppercased, non-alphanumerics → _) > bench-owned checkout (apps/benchmark/checkouts/, +// materialized by `bench setup`) > sibling-checkout WORKSPACE dir. // Shape is VALIDATED at load time so a typo fails with the // file name, not mid-run with a compile error; projects missing on this machine are reported // once, aggregated, and skipped. import type { Prototypes } from '@asmlift/core/proto'; +import { type SymbolMap, symbolMapFromJson } from '@asmlift/core/symbols'; import { existsSync, readFileSync, readdirSync } from 'node:fs'; import { join } from 'node:path'; import { gunzipSync } from 'node:zlib'; @@ -41,6 +43,14 @@ export interface RealManifest { note?: string; toolchain: ToolchainId; repoDir: string; // project checkout dir name, resolved against WORKSPACE (or ASMLIFT_PROJ_*) + /** GitHub `owner/name` of the benchmark fork (never a URL) — `bench setup` clones it. */ + repo: string; + /** The pinned integration branch on that fork (provenance base + one integration commit); + * `bench vendor`/`bench fidelity` verify the checkout sits on its remote head. */ + branch: string; + /** Make target that derives the ELF `decomp.yaml` names (DWARF types-sidecar projects: + * af/marioparty3/snowboardkids2). Absent ⇒ the plain project build produces the ELF. */ + elfMake?: string; cppIncludes: string[]; // preprocessor flags (e.g. ["-nostdinc","-I","tools/agbcc/include"]) headers: string[]; // project headers to #include so types resolve defines?: string[]; // extra -D macros @@ -53,14 +63,35 @@ export interface VendoredManifest extends RealManifest { vendored: (sym: string) => { tuI: string; ctxI: string }; /** sym → repo-relative path of the vendored context blob (for the row's ctxRef). */ ctxPath: (sym: string) => string; + /** the project's vendored symbol map (names + declaration shapes), when it exposes an ELF */ + symbols?: SymbolMap; } export const REAL_DIR = join(import.meta.dirname, '..', '..', 'dataset', 'real'); -/** ASMLIFT_PROJ_ override, else the sibling-checkout default. */ -export function resolveProjectRoot(m: RealManifest): string { +/** The gitignored dir where `bench setup` clones the HARNESS-OWNED project checkouts — + * disposable clones the harness may freely mutate (build, split, venv), unlike the sibling + * WORKSPACE checkouts which carry the maintainer's WIP and are never touched. + * ASMLIFT_BENCH_CHECKOUTS relocates it (tests use a tmpdir). */ +export function benchCheckoutsDir(): string { + return process.env.ASMLIFT_BENCH_CHECKOUTS ?? join(import.meta.dirname, '..', '..', 'checkouts'); +} + +/** The project's ASMLIFT_PROJ_ env override, if set. */ +export function projectEnvOverride(m: RealManifest): string | undefined { const envName = `ASMLIFT_PROJ_${m.project.toUpperCase().replace(/[^A-Z0-9]/g, '_')}`; - return process.env[envName] ?? join(WORKSPACE, m.repoDir); + return process.env[envName]; +} + +/** Checkout resolution order: ASMLIFT_PROJ_ env override > bench-owned checkout + * (apps/benchmark/checkouts/, when present) > sibling WORKSPACE dir. */ +export function resolveProjectRoot(m: RealManifest): string { + const override = projectEnvOverride(m); + if (override) { + return override; + } + const owned = join(benchCheckoutsDir(), m.repoDir); + return existsSync(owned) ? owned : join(WORKSPACE, m.repoDir); } /** Validate one manifest's shape. Returns the problems (empty = valid). */ @@ -76,6 +107,16 @@ export function validateManifest(m: unknown, file: string): string[] { if (typeof man.repoDir !== 'string' || !man.repoDir || man.repoDir.startsWith('/')) { problems.push(`${file}: "repoDir" must be a workspace-relative directory name (no absolute paths)`); } + // `owner/name` only — a URL (scheme, host, extra slashes) must fail here, not mid-clone + if (typeof man.repo !== 'string' || !/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/.test(man.repo)) { + problems.push(`${file}: "repo" must be a GitHub owner/name (no URL)`); + } + if (typeof man.branch !== 'string' || !man.branch) { + problems.push(`${file}: "branch" must be a non-empty string`); + } + if (man.elfMake !== undefined && (typeof man.elfMake !== 'string' || !man.elfMake)) { + problems.push(`${file}: "elfMake" must be a non-empty string when present`); + } if (!Array.isArray(man.cppIncludes) || !Array.isArray(man.headers)) { problems.push(`${file}: "cppIncludes"/"headers" must be arrays`); } @@ -131,8 +172,15 @@ export function loadManifests(): VendoredManifest[] { continue; } const index = JSON.parse(readFileSync(indexPath, 'utf8')) as Record; + // the project's vendored symbol map (name/shape metadata derived from its ELF at vendor + // time) — absent for projects without a tools.asmlift.elf, and rows then run as before + const symbolsPath = join(dir, 'symbols.json.gz'); + const symbols = existsSync(symbolsPath) + ? symbolMapFromJson(JSON.parse(gunzipSync(readFileSync(symbolsPath)).toString('utf8'))) + : undefined; available.push({ ...man, + symbols, vendored: (sym) => { const entry = index[sym]; if (!entry) { diff --git a/apps/benchmark/src/cases/project-elf.ts b/apps/benchmark/src/cases/project-elf.ts new file mode 100644 index 00000000..14222e6d --- /dev/null +++ b/apps/benchmark/src/cases/project-elf.ts @@ -0,0 +1,45 @@ +// Resolve (and, when possible, BUILD) the ELF a project's own decomp.yaml names +// (`tools.asmlift.elf`) — the symbol-map source. Shared by `bench vendor` (vendorSymbols) and +// the fidelity map-drift check: when the file is missing but the project Makefile exposes an +// `asmlift-elf` target (the DWARF types-sidecar projects), run it — building the derived ELF +// is the checkout's own documented recipe, not a harness invention. +import { loadDecompConfig } from '@asmlift/cli/config'; +import { execSync } from 'node:child_process'; +import { existsSync, readFileSync } from 'node:fs'; +import { dirname, join, resolve } from 'node:path'; + +export const ELF_MAKE_TARGET = 'asmlift-elf'; + +export function makefileHasAsmliftElf(root: string): boolean { + const mk = join(root, 'Makefile'); + return existsSync(mk) && new RegExp(`^${ELF_MAKE_TARGET}\\s*:`, 'm').test(readFileSync(mk, 'utf8')); +} + +export type ElfResolution = + | { elf: string; elfRel: string } // exists on disk (possibly after `make asmlift-elf`) + | { elf: null; elfRel: string | null; reason: string }; + +/** Resolve the declared ELF for the checkout at `root`; if it is not built and the Makefile + * has an `asmlift-elf` target, run it (logged). Never throws — the CALLER decides whether a + * missing ELF is a warn-and-skip (vendor) or a loud failure (fidelity). */ +export function resolveProjectElf(project: string, root: string): ElfResolution { + const loaded = loadDecompConfig(undefined, root); + const elfRel = loaded?.config.tools?.asmlift?.elf; + if (!elfRel) { + return { elf: null, elfRel: null, reason: 'decomp.yaml declares no tools.asmlift.elf' }; + } + const elfPath = resolve(dirname(loaded!.path), elfRel); + if (!existsSync(elfPath) && makefileHasAsmliftElf(root)) { + console.log(`${project}: ${elfRel} not built — running \`make ${ELF_MAKE_TARGET}\` in ${root}`); + try { + execSync(`make ${ELF_MAKE_TARGET}`, { cwd: root, stdio: 'inherit', timeout: 600_000 }); + } catch { + return { elf: null, elfRel, reason: `\`make ${ELF_MAKE_TARGET}\` failed` }; + } + } + if (!existsSync(elfPath)) { + const hint = makefileHasAsmliftElf(root) ? '' : ` (no \`${ELF_MAKE_TARGET}\` Makefile target — build the project)`; + return { elf: null, elfRel, reason: `${elfRel} is not built${hint}` }; + } + return { elf: elfPath, elfRel }; +} diff --git a/apps/benchmark/src/cases/project-setup.ts b/apps/benchmark/src/cases/project-setup.ts new file mode 100644 index 00000000..ec15f2ac --- /dev/null +++ b/apps/benchmark/src/cases/project-setup.ts @@ -0,0 +1,214 @@ +// Per-project recipes for BENCH-OWNED checkouts (apps/benchmark/checkouts/ — see +// manifests.benchCheckoutsDir). `bench setup` clones each fork there and runs the project's +// `prepare` steps (toolchains, venvs, generated sources); `bench setup --build` then runs the +// full VERIFIED build (every recipe ends in the project's own byte-compare gate — a non-matching +// ROM fails loudly). These recipes MUTATE the checkout they are given, so they must only ever +// run against a bench-owned clone — setup enforces that; the sibling WORKSPACE checkouts carry +// the maintainer's WIP and are read at most as a baserom copy-in source. +// +// Host facts the recipes encode (verified empirically on macOS/arm64): +// - host-tool C builds run with /usr/bin ahead of homebrew, so `cc`/`gcc` is Apple clang +// (homebrew gcc miscompiles some of the projects' host tools); +// - kleod's setup.sh needs python >= 3.11 first in PATH; +// - af needs mips-linux-gnu binutils under /opt/cross and Rosetta (x86_64 IDO recomp); +// - snowboardkids2 builds inside a linux/amd64 Docker container; +// - the KMC gcc 2.7.2 mac binaries (marioparty3) are x86_64 → Rosetta as well. +import { execSync } from 'node:child_process'; +import { existsSync, mkdirSync, readdirSync, rmSync } from 'node:fs'; +import { cpus } from 'node:os'; +import { dirname, join } from 'node:path'; + +import { benchCheckoutsDir } from './manifests'; + +export interface ProjectRecipe { + /** checkout-relative baserom paths copied in from the sibling user checkout when found */ + baseroms: string[]; + /** idempotent post-clone preparation (cheap no-op when already prepared) */ + prepare?: (dir: string) => void; + /** the full build; MUST end in the project's own byte-compare gate */ + build: (dir: string) => void; +} + +const sh = (cmd: string, cwd: string, env: NodeJS.ProcessEnv = process.env): void => { + console.log(` $ ${cmd}`); + execSync(cmd, { cwd, stdio: 'inherit', env }); +}; + +/** /usr/bin first: host-tool builds must see Apple clang as cc/gcc, not homebrew gcc. */ +const hostToolEnv = (): NodeJS.ProcessEnv => ({ ...process.env, PATH: `/usr/bin:${process.env.PATH}` }); + +/** af (and mac KMC gcc) additionally need the /opt/cross mips binutils on PATH. */ +const afBuildEnv = (): NodeJS.ProcessEnv => ({ + ...process.env, + PATH: `/usr/bin:/opt/cross/bin:${process.env.PATH}`, +}); + +/** A python3 >= 3.11 dir to prepend (kleod's setup.sh requires it first in PATH). */ +function python311Env(): NodeJS.ProcessEnv { + for (const cand of ['python3.13', 'python3.12', 'python3.11', 'python3']) { + try { + const out = execSync(`${cand} -c 'import sys; print(sys.executable, sys.version_info[:2] >= (3, 11))'`, { + encoding: 'utf8', + }).trim(); + const [exe, ok] = out.split(' '); + if (ok === 'True') { + return { ...process.env, PATH: `${dirname(exe)}:${process.env.PATH}` }; + } + } catch { + // try the next candidate + } + } + throw new Error('setup: no python3 >= 3.11 on PATH (kleod setup.sh requires it)'); +} + +const jobs = (): string => `-j${Math.min(8, cpus().length || 4)}`; + +/** Missing or contentless — an `mkdir` alone must not satisfy an "already extracted" guard. */ +const emptyDir = (p: string): boolean => !existsSync(p) || readdirSync(p).length === 0; + +/** Clone (cached under checkouts/.tools) + build an agbcc fork, and install it into the + * project (tools/agbcc/{bin,include,lib}). Skipped when the project already has the binary. */ +function installAgbcc(fork: string, projDir: string): void { + if (existsSync(join(projDir, 'tools', 'agbcc', 'bin', 'agbcc'))) { + return; + } + const cache = join(benchCheckoutsDir(), '.tools', `agbcc-${fork.replace('/', '-')}`); + if (!existsSync(cache)) { + mkdirSync(dirname(cache), { recursive: true }); + try { + sh(`git clone --depth 1 https://github.com/${fork}.git ${JSON.stringify(cache)}`, benchCheckoutsDir(), { + ...process.env, + GIT_TERMINAL_PROMPT: '0', + }); + } catch (e) { + rmSync(cache, { recursive: true, force: true }); // no half-clones in the cache + throw e; + } + } + sh('sh build.sh', cache, hostToolEnv()); + sh(`sh install.sh ${JSON.stringify(projDir)}`, cache, hostToolEnv()); +} + +/** snowboardkids2 builds inside a linux/amd64 container (KMC gcc linux binaries + splat). */ +function sbk2DockerBuild(dir: string): void { + const script = [ + 'apt-get update -qq >/dev/null', + // clang: the project's CC_CHECK advisory pass runs it on every TU + 'DEBIAN_FRONTEND=noninteractive apt-get install -y -qq build-essential clang binutils-mips-linux-gnu python3 python3-pip git wget file >/dev/null', + 'pip3 install -q --break-system-packages -r requirements.txt', + "git config --global --add safe.directory '*'", + 'make setup', + 'make -C tools', + 'make extract', + `make ${jobs()}`, + ].join(' && '); + sh( + `docker run --rm --platform linux/amd64 -v "$PWD":/w -w /w debian:bookworm bash -ec ${JSON.stringify(script)}`, + dir, + ); + // the in-container make already compares; assert the artifact really is there and matching + sh('shasum -c snowboardkids2.sha1', dir); +} + +/** Fail fast with the install remedy when a host prerequisite is missing. */ +function requireHost(check: () => boolean, what: string, remedy: string): void { + let ok = false; + try { + ok = check(); + } catch { + ok = false; + } + if (!ok) { + throw new Error(`setup: missing host prerequisite — ${what}\n remedy: ${remedy}`); + } +} + +const hasDocker = (): boolean => { + execSync('docker info', { stdio: 'ignore' }); + return true; +}; + +/** Recipes keyed by manifest `project`. */ +export const PROJECT_RECIPES: Record = { + marioparty3: { + baseroms: ['baserom.us.z64'], + prepare: (dir) => { + if (!existsSync(join(dir, 'venv'))) { + sh('python3 -m venv venv', dir); + sh('bash install.sh', dir, { ...process.env, PATH: `${join(dir, 'venv', 'bin')}:${process.env.PATH}` }); + } + if (!existsSync(join(dir, 'tools', 'gcc_2.7.2', 'mac', 'gcc'))) { + sh('gmake -C tools', dir, hostToolEnv()); + } + if (!existsSync(join(dir, 'marioparty3.ld'))) { + sh('gmake split', dir); + } + }, + build: (dir) => sh(`gmake ${jobs()}`, dir, hostToolEnv()), // COMPARE=1 diffs against the baserom + }, + + pokeemerald: { + baseroms: [], // pret builds from source; `make` compares against rom.sha1 + prepare: (dir) => { + installAgbcc('pret/agbcc', dir); + sh('gmake -C tools/mapjson', dir, hostToolEnv()); + sh('gmake -C tools/jsonproc', dir, hostToolEnv()); + sh('gmake generated', dir, hostToolEnv()); + }, + build: (dir) => sh(`gmake ${jobs()}`, dir, hostToolEnv()), // ends in `pokeemerald.gba: OK` + }, + + sa3: { + baseroms: ['baserom.gba', 'baserom_sa3.gba'], + prepare: (dir) => installAgbcc('SAT-R/agbcc', dir), + build: (dir) => sh(`gmake ${jobs()}`, dir, hostToolEnv()), // ends in `sha1sum -c sa3.sha1` + }, + + kleod: { + baseroms: ['baserom.gba'], + prepare: (dir) => { + // setup.sh: verifies the baserom, inits submodules, builds the agbcc submodule, extracts + if (!existsSync(join(dir, 'tools', 'agbcc', 'bin', 'agbcc')) || !existsSync(join(dir, 'asm', 'nonmatchings'))) { + sh('bash setup.sh', dir, python311Env()); + } + }, + build: (dir) => sh(`gmake ${jobs()}`, dir, python311Env()), // ends in `sha1sum -c klonoa-eod.sha1` + }, + + af: { + baseroms: ['baseroms/jp/baserom.z64'], + prepare: (dir) => { + requireHost( + () => existsSync('/opt/cross/bin/mips-linux-gnu-ld'), + 'mips-linux-gnu binutils under /opt/cross', + 'build big-endian mips-linux-gnu binutils with --prefix=/opt/cross (af cross toolchain)', + ); + requireHost( + () => { + execSync('arch -x86_64 /usr/bin/true', { stdio: 'ignore' }); + return true; + }, + 'Rosetta (af runs the x86_64 IDO recomp binaries)', + 'softwareupdate --install-rosetta --agree-to-license', + ); + // the project's own bootstrap chain: venv → setup (tools + baserom decompress) → extract + if (!existsSync(join(dir, '.venv'))) { + sh('gmake venv', dir, afBuildEnv()); + } + if (!existsSync(join(dir, 'baseroms', 'jp', 'baserom-decompressed.z64'))) { + sh('gmake setup', dir, afBuildEnv()); + } + // the split may have left EMPTY dirs behind — only a populated tree counts as extracted + if (emptyDir(join(dir, 'asm', 'jp')) || emptyDir(join(dir, 'assets', 'jp'))) { + sh('gmake extract', dir, afBuildEnv()); + } + }, + build: (dir) => sh(`gmake ${jobs()}`, dir, afBuildEnv()), // COMPARE=1 checks baseroms/jp/checksum.md5 + }, + + snowboardkids2: { + baseroms: ['snowboardkids2.z64'], + prepare: () => requireHost(hasDocker, 'a running Docker daemon (sbk2 builds in linux/amd64)', 'start Docker'), + build: sbk2DockerBuild, + }, +}; diff --git a/apps/benchmark/src/cases/real.ts b/apps/benchmark/src/cases/real.ts index 144de95f..eb426019 100644 --- a/apps/benchmark/src/cases/real.ts +++ b/apps/benchmark/src/cases/real.ts @@ -3,6 +3,8 @@ // score with progressively richer context up to the function's own vendored context // (makeRealScorer), so an output referencing project globals/structs is never noncompile merely // for missing context. +import { asIfUndecompiled } from '@asmlift/core/symbols'; + import { buildRealTarget, makeRealCompile, makeRealScorer } from '../compile/real'; import { sanitizeM2cContext } from '../eval/m2c-normalizer'; import { TOOLCHAINS } from '../toolchains'; @@ -37,6 +39,12 @@ export function realCases(filter: RealFilter = {}): Case[] { ctx: f.m2cCtx ? m2cRealCtx(man, f) : f.ctx, ctxRef: f.m2cCtx ? man.ctxPath(f.sym) : undefined, proto: f.proto, + // LEAKAGE-FREE by construction: every row here is a function someone already decompiled, + // so the project ELF knows things about it that a user mid-decomp cannot. Score against + // the map as it would look with this function still `INCLUDE_ASM` (core's + // asIfUndecompiled) — otherwise any future signature/local/location feature scores on + // facts it could never have in the flow the dogfood reproduces. + symbols: man.symbols && asIfUndecompiled(man.symbols, f.sym), note: f.note, toolchain: tc, build: () => buildRealTarget(man.toolchain, man.vendored(f.sym).tuI), diff --git a/apps/benchmark/src/cases/setup.ts b/apps/benchmark/src/cases/setup.ts new file mode 100644 index 00000000..e330e6e5 --- /dev/null +++ b/apps/benchmark/src/cases/setup.ts @@ -0,0 +1,252 @@ +// `bench setup` — materialize the real tier's external dependencies on a fresh machine, and +// REPORT (never touch) what the harness does not own: +// - project checkouts: each manifest names its fork (`repo`) + pinned branch (`branch`). +// Setup owns a BENCH-OWNED workspace (apps/benchmark/checkouts/, gitignored): each fork is +// cloned there (submodules included — ssh submodule URLs are rewritten to https), baseroms +// are copied in from the sibling user checkout when found, and the project's preparation +// recipe runs (toolchains, venvs, generated sources — src/cases/project-setup.ts). +// `--build` additionally runs each project's full VERIFIED build (+ its `elfMake` target). +// Resolution everywhere follows manifests.resolveProjectRoot: ASMLIFT_PROJ_* env override +// > bench-owned checkout > sibling WORKSPACE dir. NON-bench-owned checkouts (env override +// or sibling) are strictly read-only — the maintainer's checkouts carry WIP and must never +// be mutated by a harness command (a missing env-override path is still cloned, as before, +// but no recipe runs there). +// - the gcc 2.7.2 toolchain: fetched from the decompals releases into a BENCH-OWNED +// gitignored dir (@asmlift/toolchains prefers it over the marioparty3 checkout's copy), +// skipped when already present. +// Ends with a per-project status table; nonzero exit when any clone/prepare/build failed or a +// fresh clone failed verification. +import { execSync } from 'node:child_process'; +import { copyFileSync, existsSync, mkdirSync } from 'node:fs'; +import { dirname, join } from 'node:path'; + +import { WORKSPACE } from '../config'; +import { type RemoteLookup, checkoutStatus, git, provenanceCommit, remoteBranchHead } from './checkout'; +import { + type RealManifest, + benchCheckoutsDir, + loadManifestsForVendor, + projectEnvOverride, + resolveProjectRoot, +} from './manifests'; +import { PROJECT_RECIPES } from './project-setup'; + +export interface SetupRow { + project: string; + dir: string; + action: 'cloned' | 'kept' | 'clone FAILED'; + head?: string; + remoteHead?: string | null; + dirty?: boolean; + notes: string[]; +} + +const short = (sha?: string | null): string => (sha ? sha.slice(0, 7) : sha === null ? 'offline' : '-'); + +/** Injectable clone (tests stub this — no network in CI). */ +export type CloneFn = (repo: string, branch: string, dir: string) => void; + +/** Shallow clone of the pinned branch + submodules. `-c url…insteadOf` lands in the clone's + * config so ssh-URL submodules (sbk2, kleod) resolve over https on machines without git ssh. */ +export const cloneProject: CloneFn = (repo, branch, dir) => { + const env = { ...process.env, GIT_TERMINAL_PROMPT: '0' }; + // --depth 50 keeps the clone light while still containing the provenance base + // (the pinned branch is base + ONE integration commit) + execSync( + `git clone -c url.https://github.com/.insteadOf=git@github.com: --branch ${branch} --depth 50 ` + + `https://github.com/${repo}.git ${JSON.stringify(dir)}`, + { stdio: 'inherit', env }, + ); + execSync(`git -C ${JSON.stringify(dir)} submodule update --init --recursive`, { stdio: 'inherit', env }); +}; + +/** One project. Bench-owned mode (no env override): the clone target is the bench-owned + * workspace, and baserom copy-in + the preparation recipe run there. With an env override the + * legacy behavior holds: clone only when the path is missing, otherwise strictly read-only. */ +export function setupProject( + man: RealManifest, + lookupRemote: RemoteLookup = remoteBranchHead, + clone: CloneFn = cloneProject, +): SetupRow { + const envOverride = projectEnvOverride(man); + const benchOwned = envOverride === undefined; + const dir = envOverride ?? join(benchCheckoutsDir(), man.repoDir); + const notes: string[] = []; + let action: SetupRow['action'] = 'kept'; + + if (!existsSync(dir)) { + action = 'cloned'; + try { + mkdirSync(dirname(dir), { recursive: true }); + clone(man.repo, man.branch, dir); + } catch { + return { + project: man.project, + dir, + action: 'clone FAILED', + notes: [`git clone ${man.repo}#${man.branch} failed`], + }; + } + // post-clone verification: the tree must look like the project (decomp.yaml is part of the + // integration commit on every benchmark branch) and contain the vendored provenance base + if (!existsSync(`${dir}/decomp.yaml`)) { + notes.push('VERIFY: decomp.yaml missing from the cloned tree'); + } + const prov = provenanceCommit(man.project); + if (prov) { + try { + git(dir, `cat-file -e ${prov}^{commit}`); + } catch { + notes.push(`VERIFY: provenance base ${prov.slice(0, 7)} not within --depth 50`); + } + } + } + + if (benchOwned && existsSync(dir)) { + copyBaseroms(man, dir, notes); + const recipe = PROJECT_RECIPES[man.project]; + if (recipe?.prepare) { + try { + console.log(`\n[${man.project}] preparing bench-owned checkout at ${dir}`); + recipe.prepare(dir); + } catch (e) { + notes.push(`PREPARE FAILED: ${(e as Error).message.split('\n')[0]}`); + } + } + } + + const st = checkoutStatus(man, lookupRemote); + if (st.present && !st.head) { + notes.push('not a git checkout'); + } + if (action === 'kept' && st.head && st.remoteHead && st.head !== st.remoteHead) { + notes.push( + `HEAD != ${man.repo}#${man.branch} (git fetch && git checkout ${man.branch}, or move it aside and re-run setup)`, + ); + } + if (action === 'cloned' && st.head && st.remoteHead && st.head !== st.remoteHead) { + notes.push('VERIFY: fresh clone HEAD != remote branch head'); + } + return { project: man.project, dir, action, head: st.head, remoteHead: st.remoteHead, dirty: st.dirty, notes }; +} + +/** Copy the project's baserom(s) into the bench-owned checkout from the sibling user checkout + * (READ-ONLY source). Missing on both sides is a note, not an error — the project's own build + * gate fails loudly later, naming the file. */ +function copyBaseroms(man: RealManifest, dir: string, notes: string[]): void { + const recipe = PROJECT_RECIPES[man.project]; + for (const rel of recipe?.baseroms ?? []) { + const dest = join(dir, rel); + if (existsSync(dest)) { + continue; + } + const src = join(WORKSPACE, man.repoDir, rel); + if (existsSync(src)) { + mkdirSync(dirname(dest), { recursive: true }); + copyFileSync(src, dest); + console.log(`[${man.project}] copied baserom ${rel} from ${src}`); + } else { + notes.push(`baserom ${rel} missing (copy it into ${dest})`); + } + } +} + +function printTable(rows: SetupRow[]): void { + const cols = ['project', 'action', 'HEAD', 'remote', 'pinned', 'dirty', 'notes']; + const data = rows.map((r) => [ + r.project, + r.action, + short(r.head), + short(r.remoteHead), + r.head && r.remoteHead ? (r.head === r.remoteHead ? 'yes' : 'NO') : '?', + r.dirty === undefined ? '-' : r.dirty ? 'yes' : 'no', + r.notes.join('; ') || '-', + ]); + const widths = cols.map((c, i) => Math.max(c.length, ...data.map((d) => d[i].length))); + const line = (cells: string[]): string => cells.map((c, i) => c.padEnd(widths[i])).join(' '); + console.log(`\n${line(cols)}`); + console.log(widths.map((w) => '-'.repeat(w)).join(' ')); + for (const d of data) { + console.log(line(d)); + } +} + +// The decompals releases marioparty3's own tools/Makefile fetches (and CI's .deps/gcc272 +// mirrors): the gcc driver + cc1 come from mips-gcc-2.7.2, the assembler/linker from +// mips-binutils-2.6 — the old driver needs both in ONE dir. +const GCC272_URLS = [ + 'https://github.com/decompals/mips-gcc-2.7.2/releases/latest/download/gcc-2.7.2-linux.tar.gz', + 'https://github.com/decompals/mips-binutils-2.6/releases/latest/download/binutils-2.6-linux.tar.gz', +]; +export const BENCH_GCC272_DIR = join(import.meta.dirname, '..', '..', 'toolchains', 'gcc272-linux'); + +/** Fetch the bench-owned gcc 2.7.2 toolchain unless it is already there. */ +export function fetchGcc272(): string { + if (existsSync(join(BENCH_GCC272_DIR, 'gcc')) && existsSync(join(BENCH_GCC272_DIR, 'as'))) { + return `gcc2.7.2 toolchain: present at ${BENCH_GCC272_DIR}`; + } + mkdirSync(BENCH_GCC272_DIR, { recursive: true }); + for (const url of GCC272_URLS) { + console.log(`fetching ${url}`); + execSync(`curl -fsSL ${JSON.stringify(url)} | tar -xz -C ${JSON.stringify(BENCH_GCC272_DIR)}`, { + stdio: 'inherit', + }); + } + if (!existsSync(join(BENCH_GCC272_DIR, 'gcc')) || !existsSync(join(BENCH_GCC272_DIR, 'as'))) { + throw new Error(`setup: gcc2.7.2 fetch left no gcc/as in ${BENCH_GCC272_DIR}`); + } + return `gcc2.7.2 toolchain: fetched into ${BENCH_GCC272_DIR}`; +} + +/** `--build`: the project's full verified build + its `elfMake` target. BENCH-OWNED checkouts + * only — an env-override checkout is the user's to build. */ +function buildProject(man: RealManifest): string[] { + const problems: string[] = []; + if (projectEnvOverride(man) !== undefined) { + console.log(`[${man.project}] env-override checkout — skipping the bench-owned build`); + return problems; + } + const dir = resolveProjectRoot(man); + const recipe = PROJECT_RECIPES[man.project]; + if (!recipe) { + problems.push(`${man.project}: no build recipe (src/cases/project-setup.ts)`); + return problems; + } + try { + console.log(`\n[${man.project}] building at ${dir}`); + recipe.build(dir); + if (man.elfMake) { + console.log(`[${man.project}] gmake ${man.elfMake}`); + execSync(`gmake ${man.elfMake}`, { cwd: dir, stdio: 'inherit' }); + } + } catch (e) { + problems.push(`${man.project}: BUILD FAILED — ${(e as Error).message.split('\n')[0]}`); + } + return problems; +} + +export async function setup(filterProject?: string, opts: { build?: boolean } = {}): Promise { + const manifests = loadManifestsForVendor().filter((m) => !filterProject || m.project === filterProject); + const rows = manifests.map((m) => setupProject(m)); + printTable(rows); + console.log(`\n${fetchGcc272()}`); + const problems: string[] = []; + if (opts.build) { + for (const m of manifests) { + const row = rows.find((r) => r.project === m.project); + if (row?.action === 'clone FAILED' || row?.notes.some((n) => n.startsWith('PREPARE FAILED'))) { + problems.push(`${m.project}: skipped build (clone/prepare failed)`); + continue; + } + problems.push(...buildProject(m)); + } + } + const failed = rows.filter( + (r) => r.action === 'clone FAILED' || r.notes.some((n) => n.startsWith('VERIFY') || n.startsWith('PREPARE FAILED')), + ); + if (failed.length > 0 || problems.length > 0) { + throw new Error( + `setup: failures:\n ${[...failed.map((r) => `${r.project}: ${r.notes.join('; ') || r.action}`), ...problems].join('\n ')}`, + ); + } +} diff --git a/apps/benchmark/src/cases/types.ts b/apps/benchmark/src/cases/types.ts index 9ae47a99..069247dd 100644 --- a/apps/benchmark/src/cases/types.ts +++ b/apps/benchmark/src/cases/types.ts @@ -3,6 +3,7 @@ // replaces the adapter default. import type { CandidateCompiler } from '@asmlift/cli/compile-command'; import type { Prototypes } from '@asmlift/core/proto'; +import type { SymbolMap } from '@asmlift/core/symbols'; import type { Scorer } from '../eval/asmlift'; import type { BuiltTarget, Toolchain } from '../toolchains'; @@ -19,6 +20,8 @@ export interface Case { sourceUrl?: string; // real tier: GitHub permalink to the reference source ctx?: string; // m2c --context (full text — inline authored, or sanitized vendored) ctxRef?: string; // repo-relative vendored-context path, published on the row instead of ctx + /** the project's vendored symbol map — threaded into asmlift only (m2c has its ctx) */ + symbols?: SymbolMap; proto?: Prototypes; // asmlift prototypes note?: string; toolchain: Toolchain; diff --git a/apps/benchmark/src/cases/vendor.ts b/apps/benchmark/src/cases/vendor.ts index e164332b..9193ca6a 100644 --- a/apps/benchmark/src/cases/vendor.ts +++ b/apps/benchmark/src/cases/vendor.ts @@ -13,6 +13,8 @@ // // Preprocessing uses -P (no linemarkers): vendored blobs must carry NO machine paths — enforced // here and by test/real-manifests.test.ts. +import { loadSymbolMap } from '@asmlift/cli/symbols-provider'; +import { symbolMapToJson } from '@asmlift/core/symbols'; import { execSync } from 'node:child_process'; import { mkdirSync, writeFileSync } from 'node:fs'; import { join } from 'node:path'; @@ -22,13 +24,40 @@ import { sha } from '../cache'; import { makeTU, realCompilerFor } from '../compile/real'; import type { RealProjectCfg } from '../compile/types'; import { CPP } from '../config'; -import { REAL_DIR, loadManifestsForVendor, resolveProjectRoot } from './manifests'; +import { enforceCheckoutPin } from './checkout'; +import { REAL_DIR, type RealManifest, loadManifestsForVendor, resolveProjectRoot } from './manifests'; +import { resolveProjectElf } from './project-elf'; const MACHINE_PATH = /\/Users\/|\/home\/|\/private\/var\//; -export function vendor(filterProject?: string): void { +/** Vendor the project's symbol map (symbol-map-benchmark-plan-2026-07-23.md): the checkout's + * own decomp.yaml names its ELF (tools.asmlift.elf); the derived name/shape map is project + * METADATA (ldscript + headers), vendorable where the ELF itself (game code) is not. */ +async function vendorSymbols(man: RealManifest, root: string, outDir: string): Promise { + const project = man.project; + // resolveProjectElf builds a missing derived ELF via the checkout's own `make asmlift-elf` + // target when it has one (the sidecar projects) — logged; a failed/absent build keeps + // today's loud warn-and-skip. + const res = resolveProjectElf(project, root); + if (res.elf === null) { + if (res.elfRel === null) { + return; // project doesn't expose an ELF — no symbol map, rows run as before + } + console.warn(`${project}: tools.asmlift.elf points at ${res.elfRel} but ${res.reason} — symbols NOT vendored`); + return; + } + const map = await loadSymbolMap(res.elf); + const json = JSON.stringify(symbolMapToJson(map)); + writeFileSync(join(outDir, 'symbols.json.gz'), gzipSync(Buffer.from(json), { level: 9 })); + console.log(`${project}: vendored symbol map (${map.size} addresses)`); +} + +export async function vendor(filterProject?: string): Promise { const manifests = loadManifestsForVendor().filter((m) => !filterProject || m.project === filterProject); for (const man of manifests) { + // the vendored dataset must be reproducible from the pinned branch — a drifted checkout + // fails loud here (ASMLIFT_ALLOW_DIRTY_CHECKOUT=1 downgrades to a warning for WIP machines) + enforceCheckoutPin(man, 'vendor'); const root = resolveProjectRoot(man); const cfg: RealProjectCfg = { project: man.project, @@ -78,5 +107,6 @@ export function vendor(filterProject?: string): void { writeFileSync(join(outDir, 'index.json'), JSON.stringify(index, null, 2) + '\n'); writeFileSync(join(outDir, 'PROVENANCE.json'), JSON.stringify(provenance, null, 2) + '\n'); console.log(`${man.project}: vendored ${done} TUs (${ctxSeen.size} unique context(s)) → ${outDir}`); + await vendorSymbols(man, root, outDir); } } diff --git a/apps/benchmark/src/cli.ts b/apps/benchmark/src/cli.ts index 04d07678..b799c0e2 100644 --- a/apps/benchmark/src/cli.ts +++ b/apps/benchmark/src/cli.ts @@ -4,7 +4,14 @@ // pnpm bench run [--jobs N] [--tier synthetic|real|both] [--only s] [--project p] // [--serial] [--shard i/N] [--toolchain id] // pnpm bench target --out

# repro-script pre-step: target object + decomp.yaml -// pnpm bench fidelity [--jobs N] # pre-publish gate: re-run BOTH repro scripts, every function +// pnpm bench setup [--project p] [--build] +// # materialize the BENCH-OWNED project checkouts +// # (apps/benchmark/checkouts/: clone + baseroms + prepare; +// # --build runs each project's full verified build) + fetch +// # bench-owned toolchains; non-bench-owned checkouts are +// # only reported, never touched +// pnpm bench fidelity [--jobs N] [--project p] [--only s] +// # pre-publish gate: re-run BOTH repro scripts, every function // pnpm bench merge # tiers → results.json, then publish // pnpm bench publish # re-stage results.json into the web app // pnpm bench stale-check # committed vs fresh results (measurement-level) @@ -16,15 +23,20 @@ // `run` fans shard child processes by default (see run/orchestrate.ts); `--serial` runs // in-process — the debugging path, and also HOW the shard children themselves run (the parent // spawns `run --serial --shard i/N`, which writes `.part.json` for the stitcher). -import { copyFileSync, mkdirSync } from 'node:fs'; +import type { FunctionResult } from '@asmlift/bench-schema'; +import { macroDefinesUsedBy } from '@asmlift/core/macros'; +import { copyFileSync, existsSync, mkdirSync, readFileSync } from 'node:fs'; import { cpus } from 'node:os'; import { join } from 'node:path'; import { parseArgs } from 'node:util'; +import { loadManifests, loadManifestsForVendor, resolveProjectRoot } from './cases/manifests'; +import { resolveProjectElf } from './cases/project-elf'; import { realCases } from './cases/real'; import { syntheticCases } from './cases/synthetic'; +import { resolveScoringPrelude, scoringPreludes } from './compile/real'; import { RESULTS_DIR } from './config'; -import { writeScoreConfig } from './decomp-config'; +import { materializeScoringContext, writeScoreConfig } from './decomp-config'; import { merge } from './report/merge'; import { publish } from './report/publish'; import { type Tier, orchestrate } from './run/orchestrate'; @@ -43,7 +55,9 @@ const { values: opts, positionals } = parseArgs({ toolchain: { type: 'string' }, shard: { type: 'string' }, serial: { type: 'boolean', default: false }, + build: { type: 'boolean', default: false }, out: { type: 'string' }, + 'project-root': { type: 'string' }, }, }); @@ -54,6 +68,35 @@ if (opts.tier !== 'both' && opts.tier !== 'synthetic' && opts.tier !== 'real') { process.exit(2); } +/** Human names for compile/real.ts's escalation rungs, for the `bench target` log line. */ +const RUNG_NAMES = ['bare typedefs', '+ manifest prependC', 'vendored ctx']; + +/** The published WINNING source for one real row — but only when asmlift's outcome was actually + * SCORED (a declined/noncompile/failed row's stored text compiles nowhere, so it pins nothing). + * `bench target` replays the scoring escalation over it to recover the context rung the harness + * used. + * + * `results.json` first, because that is the COMMITTED file every checkout has — a user running a + * published reproduction script must land on the same rung the benchmark did. The per-tier + * `real.json` is gitignored (present only right after a local `bench run`) and serves the + * pre-merge loop. Neither present, or the row unscored ⇒ undefined, and the caller takes the + * richest rung — the behavior before the rung was derived at all. */ +function publishedAsmliftSource(rowId: string): string | undefined { + for (const file of ['results.json', 'real.json']) { + let results: FunctionResult[]; + try { + ({ results } = JSON.parse(readFileSync(join(RESULTS_DIR, file), 'utf8')) as { results: FunctionResult[] }); + } catch { + continue; + } + const row = results.find((r) => r.id === rowId); + if (row) { + return row.asmlift.outcome === 'match' || row.asmlift.outcome === 'nonmatch' ? row.asmlift.source : undefined; + } + } + return undefined; +} + function casesFor(tier: Tier) { return tier === 'synthetic' ? syntheticCases({ only: opts.only, toolchain: opts.toolchain as ToolchainId | undefined }) @@ -84,14 +127,17 @@ switch (command) { break; } case 'target': { - // target --out — the repro scripts' pre-step: build this function's target - // object (content-cached) and write a decomp.yaml whose compile command is the benchmark's - // own toolchain invocation, so `asmlift --config decomp.yaml --score-against target.o` - // scores exactly what the benchmark scored. + // target --out [--project-root ] — the repro scripts' pre-step: build + // this function's target object (content-cached) and write a decomp.yaml whose compile + // command is the benchmark's own toolchain invocation, so `asmlift --config decomp.yaml + // --score-against target.o` scores exactly what the benchmark scored. Symbol-fed rows + // additionally graft the project checkout's tools.asmlift.elf (the symbol-map source) into + // that decomp.yaml — --project-root names the checkout (default: the same resolution the + // harness uses); a missing checkout/ELF warns LOUDLY and degrades to a map-less config. const rowId = positionals[1]; const out = opts.out; if (!rowId || !out) { - console.error('usage: pnpm bench target --out '); + console.error('usage: pnpm bench target --out [--project-root ]'); process.exit(2); } const c = [...syntheticCases(), ...realCases()].find((x) => x.id === rowId); @@ -102,8 +148,63 @@ switch (command) { mkdirSync(out, { recursive: true }); const { obj } = c.build(); copyFileSync(obj, join(out, 'target.o')); - writeScoreConfig(c.toolchain.id, out); - console.log(`Wrote ${join(out, 'target.o')} + decomp.yaml (${c.toolchain.id})`); + let elf: string | undefined; + if (c.symbols) { + // the row was MEASURED with the project's symbol map — resolve the checkout's derived + // symbols ELF so the CLI loads the same map the benchmark fed this function + const man = loadManifestsForVendor().find((m) => m.project === c.project); + const root = opts['project-root'] ?? (man ? resolveProjectRoot(man) : undefined); + const mapless = (why: string): void => + console.error( + `WARN: ${c.project}: ${why} — decomp.yaml written WITHOUT tools.asmlift.elf (the ` + + `symbol map); output may differ from the published row`, + ); + if (root === undefined || !existsSync(root)) { + mapless(`project checkout not found${root ? ` at ${root}` : ''} (set PROJECT_PATH / --project-root)`); + } else { + const res = resolveProjectElf(c.project, root); + if (res.elf !== null) { + elf = res.elf; + } else { + mapless(`symbol map unavailable (${res.reason})`); + } + } + } + // REAL rows are scored inside an ESCALATING context (compile/real.ts) — materialize the rung + // the harness actually stopped at for this row, so the generated compile command grades the + // candidate in the same world the benchmark did. Not always the richest: a project context + // can reject what bare typedefs accept (its prototype vs. an implicitly-declared call), and + // the row's published source is the evidence of where escalation stopped — so replay the + // ladder against it. (Synthetic rows have no context: they are scored bare, config stays bare.) + let ctxFile: string | undefined; + let ctxRung = 0; + if (c.tier === 'real') { + const man = loadManifests().find((m) => m.project === c.project); + if (man) { + const { ctxI } = man.vendored(c.sym); + const prependC = man.functions.find((f) => f.sym === c.sym)?.prependC ?? ''; + const source = publishedAsmliftSource(rowId); + const ladder = scoringPreludes(prependC, ctxI, c.sym); + // Address-cast macro defines the published source NAMES. Every rung needs them (the + // scoring compile prepends them too), and the reproduction context must carry them or + // the published script cannot build the source the benchmark published. + const macros = source && man.symbols ? macroDefinesUsedBy(man.symbols, source) : ''; + // Only a SCORED row's source pins a rung. declined/noncompile/failed rows have no source + // that compiles anywhere (a marker stub, an error string), so replaying would just burn + // three compiles to land on the richest rung — take it directly. + const picked = source + ? resolveScoringPrelude(c.toolchain.id, prependC, ctxI, c.sym, source, macros) + : { prelude: ladder[ladder.length - 1], rung: ladder.length }; + ctxRung = picked.rung; + ctxFile = materializeScoringContext(picked.prelude + macros, out); + } + } + writeScoreConfig(c.toolchain.id, out, elf, ctxFile); + console.log( + `Wrote ${join(out, 'target.o')} + decomp.yaml (${c.toolchain.id}${elf ? ' + symbol-map ELF' : ''}${ + ctxFile ? ` + scoring context (escalation rung ${ctxRung}: ${RUNG_NAMES[ctxRung - 1] ?? 'vendored ctx'})` : '' + })`, + ); break; } case 'fidelity': { @@ -113,7 +214,12 @@ switch (command) { process.exit(2); } const { fidelity } = await import('./run/fidelity'); - await fidelity(jobs); + await fidelity(jobs, { project: opts.project, only: opts.only }); + break; + } + case 'setup': { + const { setup } = await import('./cases/setup'); + await setup(opts.project, { build: opts.build }); break; } case 'merge': @@ -147,7 +253,7 @@ switch (command) { break; case 'vendor': { const { vendor } = await import('./cases/vendor'); - vendor(opts.project); + await vendor(opts.project); break; } case 'verify': { @@ -161,7 +267,7 @@ switch (command) { } default: console.error( - `usage: bench — got ${JSON.stringify(command)}`, + `usage: bench — got ${JSON.stringify(command)}`, ); process.exit(2); } diff --git a/apps/benchmark/src/compile/real.ts b/apps/benchmark/src/compile/real.ts index d89082a0..768e9ab5 100644 --- a/apps/benchmark/src/compile/real.ts +++ b/apps/benchmark/src/compile/real.ts @@ -6,6 +6,7 @@ // asmlift's canonical flags for the ISA (not the project's exact flags): the target is our // deterministic re-compile of real game code, not the shipped ROM object. import { type MatchScore, scoreObjects } from '@asmlift/cli/score'; +import { macroDefinesOf } from '@asmlift/core/declare'; import { C_TYPEDEFS } from '@asmlift/core/target'; import type { BuiltTarget, ToolchainId } from '../toolchains'; @@ -15,6 +16,7 @@ import { idoReal } from './ido'; import { kmcReal } from './kmc'; import { mwccReal } from './mwcc'; import type { RealCompile, RealProjectCfg } from './types'; +import { ctxTypedefPrelude } from './util'; export type { RealProjectCfg } from './types'; @@ -52,33 +54,49 @@ export function buildRealTarget(toolchain: ToolchainId, tuI: string): BuiltTarge // not a decompiler weakness. The scorer therefore escalates context, up to the function's // VENDORED preprocessed context (the same text the target compiled against). +/** The escalation ladder for ONE real function: complete prelude texts, cheapest → richest, + * each ready to be concatenated ahead of a candidate. + * + * 1. bare C_TYPEDEFS — enough for a candidate that names nothing of the project; + * 2. + the manifest's prependC (skipping C_TYPEDEFS when that prelude owns `u8` already); + * 3. the function's VENDORED preprocessed context — its real types + extern globals, with the + * prototype of `sym` itself stripped (the candidate's definition must be the only one) and + * the typedefs that context does not itself define added back (ctxTypedefPrelude — the SAME + * helper decomp-config.ts materializes into the reproduction's ctx.i). + * + * Every rung re-provides `NULL`: the vendored context is PREPROCESSED, so the standard macro is + * expanded away, and a candidate spelling a null check the idiomatic way (`p != NULL`, as m2c + * does) would fail to compile purely for that while a `p != 0` candidate (as asmlift emits) + * would not. Both decompilers are judged on the code, not on this artifact. + * + * EXPORTED because the reproduction scripts must materialize the very rung the harness used — + * see resolveScoringPrelude. */ +export function scoringPreludes(prependC: string, ctxI: string, sym: string): string[] { + const proDefsU8 = /typedef\s+unsigned\s+char\s+u8\b/.test(prependC); + const rungs = [ + `${C_TYPEDEFS}\n`, + `${proDefsU8 ? '' : C_TYPEDEFS}\n${prependC}\n`, + ...(ctxI ? [`${ctxTypedefPrelude(ctxI)}${stripPrototype(ctxI, sym)}\n`] : []), + ]; + return rungs.map((r) => `#define NULL ((void *)0)\n${r}`); +} + /** Compile a candidate in the project's escalating context, returning the object of the FIRST - * prelude that compiles (cheap C_TYPEDEFS → +prependC → the vendored project context). The - * context is what lets an emission referencing project types/GLOBALS compile at all — the same - * context m2c is scored in, so asmlift's real-tier scoring is symmetric. Throws if none compile. */ + * prelude that compiles. The context is what lets an emission referencing project types/GLOBALS + * compile at all — the same context m2c is scored in, so asmlift's real-tier scoring is + * symmetric. Throws if none compile. */ export function makeRealCompile(toolchain: ToolchainId, prependC: string, ctxI: string) { - const proDefsU8 = /typedef\s+unsigned\s+char\s+u8\b/.test(prependC); const rc = realCompilerFor(toolchain); - return (candC: string, sym: string): string => { - // cheap → rich. candidate never typedefs u8, so C_TYPEDEFS is safe in (1); in (2) skip it if - // the prelude already defines u8; (3) uses the vendored context's own types + extern globals - // (the prototype of `sym` itself stripped, so the candidate's own definition is the only one). - const strategies: (string | null)[] = [ - `${C_TYPEDEFS}\n`, - `${proDefsU8 ? '' : C_TYPEDEFS}\n${prependC}\n`, - ctxI ? `${stripPrototype(ctxI, sym)}\n` : null, - ]; + return (candC: string, sym: string, _backendId?: string, declarations?: string): string => { + // The candidate's ADDRESS-CAST MACRO defines ride every rung. Every rung here is a headers + // world — rungs 1/2 are asmlift's own prelude, rung 3 the project's PREPROCESSED context — + // and none of them can contain a macro, so a macro-named candidate is `undeclared identifier` + // without this. The rest of the synthesized block stays dropped: the context owns it. + const macros = macroDefinesOf(declarations); let lastErr = ''; - for (const prelude of strategies) { - if (prelude === null) { - continue; - } + for (const prelude of scoringPreludes(prependC, ctxI, sym)) { try { - // COMPAT: the vendored context is PREPROCESSED, so the standard `NULL` macro is expanded - // away — a candidate that spells a null check the idiomatic way (`p != NULL`, as m2c does) - // would fail to compile purely for that, while a `p != 0` candidate (as asmlift emits) would - // not. Re-provide it so both decompilers' output is judged on the code, not on this artifact. - return rc.compileCandidate(`#define NULL ((void *)0)\n${prelude}${candC}\n`, sym); + return rc.compileCandidate(`${prelude}${macros}${candC}\n`, sym); } catch (e) { lastErr = (e as Error).message; } @@ -87,6 +105,36 @@ export function makeRealCompile(toolchain: ToolchainId, prependC: string, ctxI: }; } +/** Which rung of the ladder a KNOWN source actually compiles in — i.e. the world the harness + * scored that source in. `bench target` replays it over a published row's winning source so the + * reproduction script grades where the benchmark graded: materializing the richest rung + * unconditionally is wrong whenever escalation stopped earlier, because a richer context can + * REJECT what a poorer one accepts (a project prototype vs. the candidate's implicitly-declared + * call). Costs 1–3 candidate compiles. Falls back to the richest rung when nothing compiles — + * the same context today's unconditional materialization would have used. */ +export function resolveScoringPrelude( + toolchain: ToolchainId, + prependC: string, + ctxI: string, + sym: string, + candC: string, + /** the candidate's address-cast macro defines — every rung needs them (see makeRealCompile), + * and replaying the ladder WITHOUT them would fail every rung and pick the wrong one */ + macros = '', +): { prelude: string; rung: number } { + const rc = realCompilerFor(toolchain); + const preludes = scoringPreludes(prependC, ctxI, sym); + for (const [i, prelude] of preludes.entries()) { + try { + rc.compileCandidate(`${prelude}${macros}${candC}\n`, sym); + return { prelude, rung: i + 1 }; + } catch { + // next rung + } + } + return { prelude: preludes[preludes.length - 1], rung: preludes.length }; +} + /** A context-aware Scorer (real tier): compile the candidate in project context, then objdiff it * against the target. Shares makeRealCompile so asmlift and m2c compile in the identical context. */ export function makeRealScorer(toolchain: ToolchainId, prependC: string, ctxI: string) { diff --git a/apps/benchmark/src/compile/util.ts b/apps/benchmark/src/compile/util.ts index b8f316aa..113f02f6 100644 --- a/apps/benchmark/src/compile/util.ts +++ b/apps/benchmark/src/compile/util.ts @@ -1,4 +1,5 @@ // Shared helpers for the per-toolchain compile modules. +import { C_TYPEDEFS } from '@asmlift/core/target'; import { spawnFailure } from '@asmlift/toolchains'; import { spawnSync } from 'node:child_process'; import { createHash } from 'node:crypto'; @@ -70,3 +71,27 @@ export function contentDir(tag: string, tu: string): string { } export const shq = (s: string): string => `'${s.replaceAll("'", `'\\''`)}'`; + +/** asmlift's typedef prelude, reduced to the names a VENDORED context does not already define. + * + * Per-NAME, not all-or-nothing: a context can own SOME of the family (af's header-less + * manifests vendor just `typedef short s16;`). Adding the whole prelude then re-typedefs that + * name — a C89 hard error that makes every candidate noncompile — while adding none leaves + * the rest of the family (u8/u32/…) undeclared, which is the same noncompile from the other + * side. So keep exactly the ones the context lacks. + * + * ONE definition, deliberately: both the scoring path (compile/real.ts's richest strategy) and + * the reproduction path (decomp-config.ts's materialized ctx.i) build the same prelude, and a + * drift between them means the published script grades in a different world than the harness + * did. Returns '' when the context already owns the whole family. */ +export function ctxTypedefPrelude(ctxI: string): string { + const kept = C_TYPEDEFS.trim() + .split(';') + .filter((d) => d.trim()) + .map((d) => `${d.trim()};`) + .filter((d) => { + const name = d.match(/(\w+);$/)?.[1]; + return name ? !new RegExp(`typedef\\s+[^;]*\\b${name}\\s*;`).test(ctxI) : false; + }); + return kept.length > 0 ? `${kept.join('')}\n` : ''; +} diff --git a/apps/benchmark/src/decomp-config.ts b/apps/benchmark/src/decomp-config.ts index e32c881b..519a52fc 100644 --- a/apps/benchmark/src/decomp-config.ts +++ b/apps/benchmark/src/decomp-config.ts @@ -64,7 +64,7 @@ function substitutePlaceholders(cmd: string, id: ToolchainId): string { interface BenchDoc { name: string; platform: string; - tools: { asmlift: { target: string; compiler?: string } }; + tools: { asmlift: { target: string; compiler?: string; elf?: string } }; } /** The committed config for one toolchain, with placeholders materialized. */ @@ -132,7 +132,35 @@ export function scoreViaBenchConfig( /** Write `/decomp.yaml` for one toolchain with the candidate-compile command intact on * EVERY toolchain (one-shot docker for the pooled pair) — the config `bench target` hands the * reproduction scripts so `asmlift --config decomp.yaml --score-against` can compile with - * the benchmark's own toolchain. */ -export function writeScoreConfig(id: ToolchainId, dir: string): void { - writeFileSync(join(dir, 'decomp.yaml'), YAML.stringify(benchDoc(id, `asmlift benchmark repro (${id})`))); + * the benchmark's own toolchain. `elf` (absolute path — symbol-fed rows) lands as + * tools.asmlift.elf so the CLI loads the project's symbol map exactly as the benchmark did. */ +export function writeScoreConfig(id: ToolchainId, dir: string, elf?: string, ctxFile?: string): void { + const doc = benchDoc(id, `asmlift benchmark repro (${id})`); + if (elf) { + doc.tools.asmlift.elf = elf; + } + if (ctxFile) { + // REAL rows are scored INSIDE the escalation rung compile/real.ts stopped at for this row + // (usually the project's vendored context) — the same world m2c is scored in. Wrap the + // toolchain's own command so every + // candidate is concatenated after that context: the reproduction grades where the + // benchmark graded. The CLI's prelude probe sees a context-injecting template and drops + // its typedefs + synthesized declarations on its own, so no flag says any of this. + doc.tools.asmlift.compiler = + `cat ${ctxFile} {{inputPath}} > {{inputPath}}.ctx.c && ` + + doc.tools.asmlift.compiler!.replaceAll('{{inputPath}}', '{{inputPath}}.ctx.c'); + } + writeFileSync(join(dir, 'decomp.yaml'), YAML.stringify(doc)); +} + +/** Materialize one real row's scoring context as `/ctx.i` (returns its basename, the name + * the generated compile command concatenates ahead of every candidate). + * + * `prelude` is a rung of compile/real.ts's escalation ladder — the ONE the harness actually + * scored this row's source in (compile/real.ts's resolveScoringPrelude picks it). It is not + * always the richest: a project context can REJECT what bare typedefs accept, and materializing + * the vendored context for such a row leaves the script with no scorable candidate at all. */ +export function materializeScoringContext(prelude: string, dir: string): string { + writeFileSync(join(dir, 'ctx.i'), prelude); + return 'ctx.i'; } diff --git a/apps/benchmark/src/eval/asmlift.ts b/apps/benchmark/src/eval/asmlift.ts index ce1aa6a1..ff90d719 100644 --- a/apps/benchmark/src/eval/asmlift.ts +++ b/apps/benchmark/src/eval/asmlift.ts @@ -6,8 +6,10 @@ import type { DecompilerResult } from '@asmlift/bench-schema'; import type { CandidateCompiler } from '@asmlift/cli/compile-command'; import { decompileRanked } from '@asmlift/cli/rank'; import type { MatchScore } from '@asmlift/cli/score'; +import type { SymbolRef } from '@asmlift/core/l3/symbol-refs'; import { decompile } from '@asmlift/core/pipeline'; import type { Prototypes } from '@asmlift/core/proto'; +import type { SymbolInfo, SymbolMap } from '@asmlift/core/symbols'; import { cachedExtractAsmData } from '../cache'; import { benchCompilerFor } from '../decomp-config'; @@ -28,6 +30,7 @@ export function runAsmlift( obj: string, prototypes?: Prototypes, contextCompile?: CandidateCompiler, + symbols?: SymbolMap, ): DecompilerResult { // Side-table: extract the data-section jump table + relocations from the SAME target object so a // dense MIPS/PPC switch can recover. Best-effort — a missing/failed objdump (or agbcc, whose @@ -48,17 +51,25 @@ export function runAsmlift( ...(prototypes ? { prototypes } : {}), ...(asmData ? { asmData } : {}), ...(compile ? { compile } : {}), + // the project's vendored symbol map (names + declaration shapes). The '/raw-globals' + // ranked lever rides along, so a symbol-fed row can never score worse than without. + ...(symbols ? { symbols } : {}), }; // Phase 1 — single-shot decompile in annotate mode: every detected gap becomes an inline // ASMLIFT_ERROR marker plus a structured diagnostic. Gapped ⇒ outcome "declined", never // scored (the marker could compile via an implicit declaration and grade meaningless code). // Gap-free ⇒ proceed to ranked scoring. + // Run exactly ONCE, with the map: the core lowering spells every known map-induced escape + // legally (the addr-intify and the comparison-path rules), so a map can no longer turn a + // clean function into a decline — there is no never-worse fallback pass to arbitrate. let annotated: string; + const usedSymbols = Boolean(symbols); try { const dec = decompile(sym, asm, tc.targetDesc, { ...opts, onGap: 'annotate' }); if (dec.diagnostics.length > 0) { return { decompiler: 'asmlift', + ...(usedSymbols ? { symbolMap: true as const } : {}), outcome: 'declined', source: dec.source, score: null, @@ -75,6 +86,7 @@ export function runAsmlift( const msg = (e as Error).message ?? String(e); return { decompiler: 'asmlift', + ...(usedSymbols ? { symbolMap: true as const } : {}), outcome: 'failed', source: msg, score: null, @@ -87,10 +99,22 @@ export function runAsmlift( // Phase 2 — rank candidates (compile + objdiff-score each) and take the differ-picked best. try { - const best = decompileRanked(sym, asm, tc.targetDesc, obj, opts).best; + const ranked = decompileRanked(sym, asm, tc.targetDesc, obj, opts); + const best = ranked.best; const s = best.score; return { decompiler: 'asmlift', + ...(usedSymbols ? { symbolMap: true as const } : {}), + // Provenance of the WINNER: which candidate spelling the differ picked, and (map rows) + // which map symbols its output references — best.symbolRefs is derived in core from the + // exact tree the winning source was emitted from (post-DCE value refs only; call targets + // excluded). A raw-globals winner names nothing ⇒ the honest empty list. + candidateLabel: best.label, + // Spellings that FAILED TO BUILD. rankBy drops them so a broken sibling cannot sink a + // candidate that compiles — but dropping them SILENTLY published a clean win over a + // hidden failure, which is exactly what a scoring harness must not do. + ...(ranked.dropped.length ? { droppedCandidates: ranked.dropped } : {}), + ...(usedSymbols ? { symbolsUsed: symbolsUsedFrom(best.symbolRefs) } : {}), outcome: s.match ? 'match' : 'nonmatch', source: best.source, score: s.score, @@ -106,6 +130,7 @@ export function runAsmlift( const msg = (e as Error).message ?? String(e); return { decompiler: 'asmlift', + ...(usedSymbols ? { symbolMap: true as const } : {}), outcome: 'noncompile', source: annotated, score: null, @@ -121,6 +146,56 @@ function firstLine(s: string): string { return s.split('\n')[0].slice(0, 200); } +/** The report's human spelling of one map symbol's declaration shape ("struct Unk_03004C20 + * (24 B)", "u16[]", "scalar u8", "code") — pre-formatted HERE so the schema and the web UI + * never learn SymbolInfo's field vocabulary. Name-only symbols (no shape facts) get none. */ +export function symbolShape(info: SymbolInfo): string | undefined { + if (info.kind === 'code') { + return 'code'; + } + switch (info.shape) { + case 'struct': { + const size = info.size !== undefined ? ` (${info.size} B)` : ''; + return `struct ${info.structName ?? '?'}${size}`; + } + case 'array': + if (info.elemSize === undefined) { + return 'array'; + } + // Only a genuine scalar width spells an int type — a struct-element array (e.g. 28 B + // elements) must not masquerade as a `u224[]`. + return SCALAR_BYTES.has(info.elemSize) + ? `${intType(info.elemSize, info.elemSigned ?? false)}[]` + : `array (${info.elemSize} B/elem)`; + case 'scalar': + if (info.size === undefined) { + return 'scalar'; + } + return SCALAR_BYTES.has(info.size) + ? `scalar ${intType(info.size, info.signed ?? false)}` + : `scalar (${info.size} B)`; + case 'pointer': + return 'pointer'; + default: + return undefined; + } +} + +const SCALAR_BYTES = new Set([1, 2, 4, 8]); +const intType = (bytes: number, signed: boolean): string => `${signed ? 's' : 'u'}${bytes * 8}`; + +/** The winning candidate's map references as the schema's provenance rows — name plus the + * pre-formatted shape, sorted by name, uncapped. Absent refs (a '/raw-globals' winner names + * nothing) become the honest empty list: the map was in scope, the winner used none of it. */ +export function symbolsUsedFrom(refs: SymbolRef[] | undefined): { name: string; shape?: string }[] { + return (refs ?? []) + .map((r) => { + const shape = symbolShape(r.info); + return { name: r.name, ...(shape ? { shape } : {}) }; + }) + .sort((a, b) => a.name.localeCompare(b.name)); +} + /** Best-effort count of distinct compiler diagnostics in a captured error string. */ export function countCompileErrors(stderr: string): number { const errs = (stderr.match(/\berror:/gi) ?? []).length; diff --git a/apps/benchmark/src/eval/evaluate.ts b/apps/benchmark/src/eval/evaluate.ts index 19a86769..7c62d17f 100644 --- a/apps/benchmark/src/eval/evaluate.ts +++ b/apps/benchmark/src/eval/evaluate.ts @@ -4,6 +4,7 @@ import type { DecompilerResult, FunctionResult } from '@asmlift/bench-schema'; import type { CandidateCompiler } from '@asmlift/cli/compile-command'; import type { Prototypes } from '@asmlift/core/proto'; +import type { SymbolMap } from '@asmlift/core/symbols'; import { cachedAsmDumpText, cachedM2cResult } from '../cache'; import type { Toolchain } from '../toolchains'; @@ -25,6 +26,8 @@ export interface EvalSpec { ctx?: string; // m2c --context (full text) ctxRef?: string; // published on the row in place of large vendored ctx text proto?: Prototypes; // asmlift prototypes + /** the project's vendored symbol map — asmlift-only input (m2c's analogue is its ctx) */ + symbols?: SymbolMap; note?: string; } @@ -140,7 +143,7 @@ export function evaluate( } catch { // text-only fallback } - const asmlift = runAsmlift(tc, spec.sym, asm, obj, spec.proto, compile); + const asmlift = runAsmlift(tc, spec.sym, asm, obj, spec.proto, compile, spec.symbols); // m2c is a frozen baseline (pinned checkout): its half of the row is cached by everything it // depends on — m2c commit, toolchain, inputs, target object (cache.ts). asmlift is NEVER cached. const m2c = cachedM2cResult({ tcId: tc.id, sym: spec.sym, asm, ctx: spec.ctx, obj, lang: spec.language }, () => diff --git a/apps/benchmark/src/eval/quality.ts b/apps/benchmark/src/eval/quality.ts index a6a1b41b..f515f790 100644 --- a/apps/benchmark/src/eval/quality.ts +++ b/apps/benchmark/src/eval/quality.ts @@ -4,7 +4,7 @@ // • undecompiled glue — M2C_ERROR / M2C_UNK / unknown-type `? (` / opaque (strongest signal) // • goto / labels — structured control flow lost // • raw memory casts — `*(T*)(p + N)` instead of `p->field` / `p[i]` (no type recovery) -// • excess casts — noise +// • excess casts — noise (project-idiom ADDRESS casts exempt — see below) // // FAIRNESS: m2c's `var_X`/`temp_X` and asmlift's `a0`/`v0` are each decompiler's normal // generic-local idiom (neither recovers real names without context) — NOT penalized. Only genuine @@ -25,14 +25,38 @@ function countAll(src: string, re: RegExp): number { return (src.match(re) ?? []).length; } +// Project-idiom ADDRESS casts are EXEMPT from the casts count: `(u32)&gSym` / `(s32)&gSym` +// (core's addr-intify — integer arithmetic/compares on a link-time address) and `(u32)Func` +// (a code address stored as an integer) are the CORRECT source spelling of that construct, +// not cast noise — the decomp projects themselves write them. Textual discipline for the +// bare-identifier form: the identifier must not be a generic LOCAL (asmlift's a0/v0, m2c's +// var_X/temp_X/phi_X/argN/spN) — a u32 cast of a local is a value truncation, still noise — +// and must not be a call (`(u32)F(x)` casts the RESULT, not the address). The `&` forms are +// address spellings by construction, exempt for any identifier. +const ADDR_CAST_EXEMPT = /\(\s*[us]32\s*\)\s*&\s*[A-Za-z_]\w*|\(\s*u32\s*\)\s*([A-Za-z_]\w*)(?!\w)(?!\s*\()/g; +const GENERIC_LOCAL = /^(?:[av]\d+|arg\d+|sp\d*|var_\w+|temp_\w+|phi_\w+)$/; + +/** How many of the counted casts are exempt address spellings (always a subset of the casts + * regex's matches — each starts with a `(u32)`/`(s32)` that regex counts). */ +function countAddrCastExemptions(src: string): number { + let n = 0; + for (const m of src.matchAll(ADDR_CAST_EXEMPT)) { + if (m[1] === undefined || !GENERIC_LOCAL.test(m[1])) { + n++; + } + } + return n; +} + export function assessQuality(src: string): QualityScore { const lines = src.split('\n').filter((l) => l.trim().length > 0).length; const gotos = countAll(src, /\bgoto\b/g); const labels = countAll(src, /^\s*[A-Za-z_]\w*:\s*$/gm); - const casts = countAll( - src, - /\(\s*(?:un)?signed\b[^)]*\)|\((?:u8|u16|u32|s8|s16|s32|int|char|short|long|void|float|double)\s*\**\s*\)/g, - ); + const casts = + countAll( + src, + /\(\s*(?:un)?signed\b[^)]*\)|\((?:u8|u16|u32|s8|s16|s32|int|char|short|long|void|float|double)\s*\**\s*\)/g, + ) - countAddrCastExemptions(src); const rawMem = countAll(src, /\*\(\s*[A-Za-z_][\w ]*\*+\s*\)\s*\(/g); // *(T*)( ... ) // *(T*)0xADDR — an absolute-address deref (typically MMIO): the symbol/global was not // recovered. Counted for the report but NOT score-penalized (the score formula is pinned). diff --git a/apps/benchmark/src/report/repro-scripts.ts b/apps/benchmark/src/report/repro-scripts.ts index 0c028ee8..ac96aee6 100644 --- a/apps/benchmark/src/report/repro-scripts.ts +++ b/apps/benchmark/src/report/repro-scripts.ts @@ -5,11 +5,96 @@ // the target object + a decomp.yaml carrying the benchmark's own compile command, then the // plain CLI decompiles the embedded input and --score-against ranks candidates against it. import type { FunctionResult } from '@asmlift/bench-schema'; +import { createHash } from 'node:crypto'; +import { existsSync, readFileSync } from 'node:fs'; +import { join } from 'node:path'; +import { gunzipSync } from 'node:zlib'; +import { REAL_DIR, type RealManifest, loadManifestsForVendor } from '../cases/manifests'; import { m2cFnPrototype } from '../cases/real'; import { M2C_PINNED_COMMIT as M2C_COMMIT } from '../config'; import { M2C_CTX_ATTRIBUTE_RE, disasmToM2c, m2cTarget } from '../eval/m2c-normalizer'; +// ── real-tier provenance preambles (comments only — nothing here executes) ──────────────── +// The committed manifests are part of the dataset, so the generator can name each project's +// pinned fork/branch and the vendored symbol map without any checkout present. +let manifestCache: Map | null = null; +function manifestFor(project: string): RealManifest | null { + manifestCache ??= new Map(loadManifestsForVendor().map((m) => [m.project, m])); + return manifestCache.get(project) ?? null; +} + +const mapShaCache = new Map(); +/** sha256 of the DECOMPRESSED vendored symbol-map JSON — the map's identity across machines + * (the .gz bytes vary with compressor settings; the JSON is byte-stable by construction). */ +function vendoredMapSha(project: string): string | null { + let sha = mapShaCache.get(project); + if (sha === undefined) { + const p = join(REAL_DIR, 'tu', project, 'symbols.json.gz'); + sha = existsSync(p) + ? createHash('sha256') + .update(gunzipSync(readFileSync(p))) + .digest('hex') + : null; + mapShaCache.set(project, sha); + } + return sha; +} + +/** The full checkout recipe for a real row: the PINNED benchmark branch of the project's fork + * (provenance base + one integration commit), the build, and — sidecar projects — the derived + * symbols ELF. Comments only: the vendored inputs below keep the script itself checkout-free. */ +function checkoutRecipe(fn: FunctionResult): string { + const man = fn.tier === 'real' ? manifestFor(fn.project) : null; + if (!man) { + return ''; + } + const dir = man.repoDir; + return ` + +# This function's decomp project — the PINNED benchmark branch (provenance base + one +# integration commit). Not needed to run this script (inputs are embedded/vendored); to +# rebuild the project itself: +# git clone --branch ${man.branch} https://github.com/${man.repo}.git ${dir} +# make -C ${dir}${ + man.elfMake + ? ` +# make -C ${dir} ${man.elfMake} # derive the symbols ELF (DWARF types-sidecar)` + : '' + }`; +} + +/** Whether this row's script must load the project's symbol map (the row was measured with + * it, and the committed manifest names the checkout dir the script's placeholder points at). */ +function usesSymbolMap(fn: FunctionResult): boolean { + return fn.tier === 'real' && Boolean(fn.asmlift.symbolMap) && manifestFor(fn.project) !== null; +} + +/** The symbol-map provenance note for a real row (asmlift script only — the map is asmlift's + * analogue of m2c's context input). Map rows also declare the PROJECT_PATH placeholder here: + * step 1 grafts that checkout's tools.asmlift.elf into the scoring config, so the CLI loads + * the same map the benchmark fed this function. */ +function symbolsNote(fn: FunctionResult): string { + if (fn.tier !== 'real') { + return ''; + } + if (usesSymbolMap(fn)) { + const rel = `apps/benchmark/dataset/real/tu/${fn.project}/symbols.json.gz`; + const sha = vendoredMapSha(fn.project); + return ` +# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived +# from the ELF its decomp.yaml names), vendored at ${rel} +# sha256 of the decompressed map JSON: ${sha ?? 'unavailable (vendored blob not present)'} +# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments); +# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) — +# the CLI loads the same map, so this run reproduces the row's named spellings. A missing +# checkout/ELF warns and runs map-less (output may then differ from the row). +PROJECT_PATH='/path/to/${manifestFor(fn.project)!.repoDir}'`; + } + return ` +# (no symbols needed: this row ran without a project symbol map.)`; +} + /** One bash-array element with its explanatory comment, comment column aligned. A long flag * must still get ≥1 space before `#` — a glued `flag#comment` is NOT a comment in bash and * feeds the comment words to the tool as arguments. */ @@ -124,24 +209,32 @@ PROTO_INPUT` const realNote = fn.tier === 'real' ? ` -# (real tier: the benchmark scored candidates inside the project's own typedef context; this -# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade -# differently than the published row)` +# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the +# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates +# it ahead of every candidate, so this scores in the same world the benchmark did)` : ''; return `#!/usr/bin/env bash # Reproduce asmlift on \`${fn.sym}\` — benchmark function ${fn.id}. set -euo pipefail # asmlift checkout — run \`pnpm install\` there once, with this function's toolchain available -# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete -# from-scratch setup): -ASMLIFT_PATH='/path/to/asmlift' +# (\`pnpm bench setup\` fetches bench-owned toolchains + pinned project checkouts; +# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a +# complete from-scratch setup): +ASMLIFT_PATH='/path/to/asmlift'${checkoutRecipe(fn)}${symbolsNote(fn)} # ── Step 1: scoring inputs ─────────────────────────────────────────────────── # Builds this function's target object (content-cached) and writes a decomp.yaml whose compile -# command is the benchmark's own toolchain invocation — what --score-against compiles with. +# command is the benchmark's own toolchain invocation — what --score-against compiles with.${ + usesSymbolMap(fn) + ? ` +# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.` + : '' + } # (progress goes to stderr so the script's stdout stays purely the decompiled source) -pnpm --dir "$ASMLIFT_PATH" bench target ${fn.id} --out "$PWD" 1>&2 +pnpm --dir "$ASMLIFT_PATH" bench target ${fn.id} --out "$PWD"${ + usesSymbolMap(fn) ? ' --project-root "$PROJECT_PATH"' : '' + } 1>&2 # ── Step 2: the input the benchmark fed asmlift, verbatim ──────────────────── # The exact ${asmKind} text. diff --git a/apps/benchmark/src/run/fidelity.ts b/apps/benchmark/src/run/fidelity.ts index 4b32e28d..9bd67abe 100644 --- a/apps/benchmark/src/run/fidelity.ts +++ b/apps/benchmark/src/run/fidelity.ts @@ -7,17 +7,22 @@ // fail — the script itself broke (bash/usage/timeout/pre-step), the m2c output diverged from // the row (its inputs are fully published, byte-equality is the contract), or an // asmlift SYNTHETIC run landed on a different outcome/source than the row. -// warn — an asmlift divergence in a class the scripts themselves document as approximate: -// real-tier scoring context, and prototype hints the CLI cannot carry. Warns are -// listed one-per-row — visible, never silent — but do not block publish. +// warn — an asmlift divergence on a real-tier row. The scripts reproduce the benchmark's +// scoring context by construction (`bench target` materializes the row's vendored +// ctx into the compile command), so drift here means environment skew, not a +// documented approximation. Warns are listed one-per-row — visible, never silent — +// but do not block publish. import type { FunctionResult } from '@asmlift/bench-schema'; -import { spawn } from 'node:child_process'; +import { execSync, spawn } from 'node:child_process'; import { mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs'; import { tmpdir } from 'node:os'; import { join } from 'node:path'; +import { enforceCheckoutPin } from '../cases/checkout'; +import { loadManifestsForVendor, resolveProjectRoot } from '../cases/manifests'; import { M2C_DIR, REPO_ROOT, RESULTS_DIR } from '../config'; import { asmliftScript, m2cScript } from '../report/repro-scripts'; +import { checkSymbolMapDrift, vendoredMapPath } from './symbol-drift'; interface Verdict { id: string; @@ -52,11 +57,26 @@ function runScript(script: string): Promise<{ code: number; stdout: string; stde }); } -/** Fill the user placeholders with this machine's real paths — the ONLY edit a user makes. */ -function materialize(script: string): string { - return script +/** Fill the user placeholders with this machine's real paths — the ONLY edit a user makes. + * `projectRoot` (symbol-fed rows) replaces the script's PROJECT_PATH checkout placeholder, + * whatever repoDir it names. Exported for the substitution unit test. */ +export function materialize(script: string, projectRoot?: string): string { + let s = script .replace("M2C_PATH='/path/to/m2c'", `M2C_PATH='${M2C_DIR}'`) .replace("ASMLIFT_PATH='/path/to/asmlift'", `ASMLIFT_PATH='${REPO_ROOT}'`); + if (projectRoot !== undefined) { + s = s.replace(/PROJECT_PATH='\/path\/to\/[^']*'/, `PROJECT_PATH='${projectRoot}'`); + } + return s; +} + +// The row's checkout, resolved exactly as vendor does (env override > bench-owned > sibling +// workspace). Missing checkouts still substitute — `bench target` then warns loudly and the +// script runs map-less, the same visible degradation a user without the checkout gets. +let rootCache: Map | null = null; +function projectRootFor(project: string): string | undefined { + rootCache ??= new Map(loadManifestsForVendor().map((m) => [m.project, resolveProjectRoot(m)])); + return rootCache.get(project); } async function checkM2c(r: FunctionResult): Promise { @@ -73,7 +93,8 @@ async function checkM2c(r: FunctionResult): Promise { } async function checkAsmlift(r: FunctionResult): Promise { - const { code, stdout, stderr } = await runScript(materialize(asmliftScript(r))); + const root = r.tier === 'real' ? projectRootFor(r.project) : undefined; + const { code, stdout, stderr } = await runScript(materialize(asmliftScript(r), root)); if (code >= 2) { return { id: r.id, tool: 'asmlift', status: 'fail', reason: `script exited ${code}: ${stderr.slice(0, 200)}` }; } @@ -101,6 +122,22 @@ async function checkAsmlift(r: FunctionResult): Promise { reason: `declined row: exit ${code}, stderr lacks [declined]`, }; } + if (r.asmlift.outcome === 'noncompile') { + // the row's `source` is the ANNOTATE-mode emission (marker-free, but it does not compile); + // the scoring-mode CLI the script runs never gets a scorable object, so it exits 1 with an + // EMPTY stdout. Comparing stdout to the row's source would therefore always "diverge" — + // what must reproduce is the FAILURE, so assert the exit + the no-candidate signature and + // leave stdout alone. + if (code === 1 && stderr.includes(`no scorable candidate for '${r.sym}'`)) { + return { id: r.id, tool: 'asmlift', status: 'ok' }; + } + return { + id: r.id, + tool: 'asmlift', + status: r.tier === 'real' ? 'warn' : 'fail', + reason: `noncompile row: exit ${code}, stderr lacks "no scorable candidate for '${r.sym}'"`, + }; + } const wantExit = r.asmlift.outcome === 'match' ? 0 : 1; const sameExit = code === wantExit; const sameSource = stdout.trim() === r.asmlift.source.trim(); @@ -110,15 +147,49 @@ async function checkAsmlift(r: FunctionResult): Promise { const reason = `${sameExit ? '' : `exit ${code} (row: ${r.asmlift.outcome})`}${sameExit || sameSource ? '' : '; '}${ sameSource ? '' : 'source diverged' }`; - // real tier scores outside the project context; prototype hints are not expressible via the - // CLI — both documented in the scripts themselves. Divergence there is a WARN, not a fail. + // real tier: the script scores inside the row's vendored context (`bench target` + // materializes it), so a divergence here is environment skew — kept a visible WARN rather + // than a hard fail so one machine quirk cannot block publish silently or loudly wrongly. return { id: r.id, tool: 'asmlift', status: r.tier === 'real' ? 'warn' : 'fail', reason }; } -export async function fidelity(jobs: number): Promise { +export interface FidelityFilter { + project?: string; + only?: string; // substring match on the symbol (spot-checks) +} + +export async function fidelity(jobs: number, filter: FidelityFilter = {}): Promise { const { assertM2cPinned } = await import('../eval/m2c'); assertM2cPinned(); - const rows = loadRows(); + // The asmlift scripts invoke the checkout's own bin — packages/cli/dist/asmlift.mjs, a + // GITIGNORED esbuild bundle. Rebuild it first: certifying the published scripts against a + // stale (or absent) bundle silently tests old code — the exact drift this gate exists to + // catch. Loud on failure; ~20ms when up to date. + execSync('pnpm --dir packages/cli build', { cwd: REPO_ROOT, stdio: 'pipe' }); + let rows = loadRows(); + if (filter.project) { + rows = rows.filter((r) => r.project === filter.project); + } + const only = filter.only; + if (only) { + rows = rows.filter((r) => r.sym.includes(only)); + } + // Checkout-pin pre-step: the published rows claim provenance from each project's pinned + // benchmark branch; a drifted LOCAL checkout can't invalidate the vendored dataset the + // scripts run against, but it CAN mean the published pin no longer describes reality — so + // verify before certifying the scripts. Missing checkouts warn (CI runs checkout-free). + const realProjects = new Set(rows.filter((r) => r.tier === 'real').map((r) => r.project)); + for (const man of loadManifestsForVendor().filter((m) => realProjects.has(m.project))) { + const st = enforceCheckoutPin(man, 'fidelity', { onMissing: 'warn' }); + // Map-drift: symbol-fed rows are only trustworthy if the vendored map still IS what the + // checkout's ELF derives. Requires the checkout; without one the pin warning above already + // fired — restate that the map specifically went unverified. + if (st.present && st.head) { + await checkSymbolMapDrift(man); + } else if (vendoredMapPath(man.project)) { + console.warn(`WARN fidelity: ${man.project}: no checkout — vendored symbol map NOT verified`); + } + } const work = rows.flatMap((r) => [() => checkM2c(r), () => checkAsmlift(r)]); const verdicts: Verdict[] = []; let next = 0; diff --git a/apps/benchmark/src/run/runner.ts b/apps/benchmark/src/run/runner.ts index 14043a46..4208ebed 100644 --- a/apps/benchmark/src/run/runner.ts +++ b/apps/benchmark/src/run/runner.ts @@ -102,6 +102,7 @@ export function runCases(cases: Case[], outPath: string, shard: Shard = { idx: 0 ctx: c.ctx, ctxRef: c.ctxRef, proto: c.proto, + symbols: c.symbols, note: c.note, }; const r = evaluate(c.toolchain, spec, obj, asm, c.scorer, c.compile); diff --git a/apps/benchmark/src/run/symbol-drift.ts b/apps/benchmark/src/run/symbol-drift.ts new file mode 100644 index 00000000..640d5dbd --- /dev/null +++ b/apps/benchmark/src/run/symbol-drift.ts @@ -0,0 +1,68 @@ +// The symbol-map half of the fidelity gate: the vendored map (dataset/real/tu/

/ +// symbols.json.gz) claims to be DERIVED from the checkout's own decomp.yaml ELF — so before +// certifying the published rows, re-derive it and hold the two equal by hash. Any drift means +// the published symbol-fed rows no longer describe the pinned project state: fail loud naming +// the remedy (`bench vendor --project

`). The comparison is over the DECOMPRESSED JSON +// (symbolMapToJson is byte-stable: hex keys sorted, array order preserved — the exact bytes +// vendor wrote); gzip envelopes vary by compressor and never participate. +import { loadSymbolMap } from '@asmlift/cli/symbols-provider'; +import { symbolMapToJson } from '@asmlift/core/symbols'; +import { createHash } from 'node:crypto'; +import { existsSync, readFileSync } from 'node:fs'; +import { join } from 'node:path'; +import { gunzipSync } from 'node:zlib'; + +import { allowDirtyCheckout } from '../cases/checkout'; +import { REAL_DIR, type RealManifest, resolveProjectRoot } from '../cases/manifests'; +import { resolveProjectElf } from '../cases/project-elf'; + +const sha256 = (s: string | Buffer): string => createHash('sha256').update(s).digest('hex'); + +/** The project's vendored symbol-map blob, when it has one. */ +export function vendoredMapPath(project: string): string | null { + const p = join(REAL_DIR, 'tu', project, 'symbols.json.gz'); + return existsSync(p) ? p : null; +} + +/** Pure comparison over the two decompressed JSON texts: null when identical, else a + * human-readable mismatch (the testable core of the drift check). */ +export function symbolMapDrift(vendoredJson: string | Buffer, derivedJson: string | Buffer): string | null { + const vendored = sha256(vendoredJson); + const derived = sha256(derivedJson); + return vendored === derived + ? null + : `vendored map sha256 ${vendored.slice(0, 12)}… != re-derived ${derived.slice(0, 12)}…`; +} + +/** Fidelity pre-step for one project with a vendored map: re-derive from the checkout's + * decomp.yaml ELF (building it via `make asmlift-elf` when the checkout exposes the target) + * and compare hashes. Unverifiable or drifted ⇒ loud error — downgraded to a warning by + * ASMLIFT_ALLOW_DIRTY_CHECKOUT=1 (the same WIP-machine escape hatch the checkout pin uses). */ +export async function checkSymbolMapDrift(man: RealManifest): Promise { + const vendoredPath = vendoredMapPath(man.project); + if (!vendoredPath) { + return; // project vendors no symbol map — nothing to hold + } + const complain = (msg: string): void => { + if (allowDirtyCheckout()) { + console.warn(`WARN fidelity: ${msg} — allowed by ASMLIFT_ALLOW_DIRTY_CHECKOUT=1`); + } else { + throw new Error(`fidelity: ${msg}`); + } + }; + const res = resolveProjectElf(man.project, resolveProjectRoot(man)); + if (res.elf === null) { + complain(`${man.project}: vendored symbol map is UNVERIFIABLE — ${res.reason}`); + return; + } + const derived = JSON.stringify(symbolMapToJson(await loadSymbolMap(res.elf))); + const vendored = gunzipSync(readFileSync(vendoredPath)).toString('utf8'); + const drift = symbolMapDrift(vendored, derived); + if (drift) { + complain(`${man.project}: symbol map DRIFTED (${drift}) — re-run \`pnpm bench vendor --project ${man.project}\``); + } else { + console.log( + `fidelity: ${man.project} symbol map verified against ${res.elfRel} (${sha256(vendored).slice(0, 12)}…)`, + ); + } +} diff --git a/apps/benchmark/test/decomp-config.test.ts b/apps/benchmark/test/decomp-config.test.ts index 00a1dee2..d9e5e293 100644 --- a/apps/benchmark/test/decomp-config.test.ts +++ b/apps/benchmark/test/decomp-config.test.ts @@ -5,10 +5,15 @@ // expected strings below are built from the same pins the built-in compile path uses, so a flag // edited in only one place fails here loudly. import { GCC_KMC_TOOLCHAIN, IDO_TOOLCHAIN, MWCC_PPC_TOOLCHAIN, TOOLCHAIN } from '@asmlift/toolchains'; +import { mkdtempSync, readFileSync, rmSync } from 'node:fs'; +import { tmpdir } from 'node:os'; +import { join } from 'node:path'; import { describe, expect, test } from 'vitest'; +import YAML from 'yaml'; +import { scoringPreludes } from '../src/compile/real'; import { shq } from '../src/compile/util'; -import { renderScoreCommand } from '../src/decomp-config'; +import { materializeScoringContext, renderScoreCommand, writeScoreConfig } from '../src/decomp-config'; describe('committed decomp.yaml configs mirror the built-in toolchain invocations', () => { test('agbcc: cpp → agbcc → as, built-in flags (compileCandAgbcc)', () => { @@ -50,3 +55,116 @@ describe('committed decomp.yaml configs mirror the built-in toolchain invocation ); }); }); + +describe('writeScoreConfig (the repro decomp.yaml)', () => { + interface Doc { + tools: { asmlift: { target: string; compiler?: string; elf?: string } }; + } + const written = (elf?: string): Doc => { + const dir = mkdtempSync(join(tmpdir(), 'score-config-')); + try { + writeScoreConfig('agbcc', dir, elf); + return YAML.parse(readFileSync(join(dir, 'decomp.yaml'), 'utf8')) as Doc; + } finally { + rmSync(dir, { recursive: true, force: true }); + } + }; + + test('symbol-fed rows: the project ELF lands as tools.asmlift.elf beside the compile command', () => { + const doc = written('/checkouts/pokeemerald/pokeemerald-syms.elf'); + expect(doc.tools.asmlift.elf).toBe('/checkouts/pokeemerald/pokeemerald-syms.elf'); + expect(doc.tools.asmlift.compiler).toBe(renderScoreCommand('agbcc')); + expect(doc.tools.asmlift.target).toBe('agbcc'); + }); + + test('map-free rows: no elf key at all', () => { + expect('elf' in written().tools.asmlift).toBe(false); + }); +}); + +// Real rows are SCORED inside ONE rung of compile/real.ts's escalation ladder — `bench target` +// materializes that exact prelude as ctx.i and the generated compile command concatenates it +// ahead of every candidate, so the repro scripts grade in the same world the benchmark did. +// The ctx.i CONTENT is scoringPreludes' business (one definition, shared with the scorer); +// materializeScoringContext only puts the chosen rung on disk under the agreed name. +describe('real-row scoring context (ctx.i + wrapped compile command)', () => { + interface Doc { + tools: { asmlift: { target: string; compiler?: string; elf?: string } }; + } + const inDir = (f: (dir: string) => T): T => { + const dir = mkdtempSync(join(tmpdir(), 'score-ctx-')); + try { + return f(dir); + } finally { + rmSync(dir, { recursive: true, force: true }); + } + }; + /** the richest rung — what `bench target` materializes for all but the escalation-stopped rows */ + const vendoredRung = (ctxI: string, sym: string, prependC = ''): string => + scoringPreludes(prependC, ctxI, sym).at(-1)!; + + test('every rung re-provides NULL (the vendored context is preprocessed — the macro is gone)', () => { + for (const p of scoringPreludes('', 'typedef short s16;\n', 'f')) { + expect(p.startsWith('#define NULL ((void *)0)\n')).toBe(true); + } + }); + + test("the vendored rung strips the function's own prototype and keeps the rest verbatim", () => { + const text = vendoredRung('typedef unsigned char u8;\ns32 keepMe(s32);\ns32 sq(s32);\n', 'sq'); + expect(text.endsWith('typedef unsigned char u8;\ns32 keepMe(s32);\n\n')).toBe(true); // verbatim, own proto gone + expect(text).not.toContain('typedef unsigned char u8;typedef'); // the ctx already owns u8 + expect(text).toContain('typedef int s32;'); // …but not s32, so the prelude supplies it + }); + + test('the typedef guard is PER NAME — a context owning only s16 keeps the rest of the family', () => { + // af's manifests are header-less (host cpp cannot preprocess them), so their vendored + // context is literally `typedef short s16;`. An all-or-nothing guard either re-typedefs + // s16 (C89 hard error → every candidate noncompiles) or leaves u8/u32/… undeclared. + const text = vendoredRung('typedef short s16;\n', 'f'); + expect(text.match(/typedef short s16;/g)).toHaveLength(1); + expect(text).toContain('typedef unsigned char u8;'); + expect(text).toContain('typedef int s32;'); + }); + + test("a context that does not own u8 (af's header-less manifests) gets the typedef prelude", () => { + // mirror of makeRealCompile's proDefsU8 guard, generalized to the vendored context: a + // duplicate typedef is a C89 hard error, a missing one makes every candidate noncompile + expect(vendoredRung('typedef struct { unsigned int w0; } Gfx;\n', 'sq')).toContain('typedef unsigned char u8;'); + // and one that already owns u8 must NOT get a second copy + expect(vendoredRung('typedef uint8_t u8;\n', 'sq')).not.toContain('typedef unsigned char u8;'); + }); + + test('materializeScoringContext writes the CHOSEN rung verbatim as ctx.i', () => { + inDir((dir) => { + // the rung is not always the richest: a project prototype can reject what bare typedefs + // accept, and materializing the vendored ctx for such a row leaves NO scorable candidate + const rung1 = scoringPreludes('', 'u32 thunk(void);\n', 'f')[0]; + expect(materializeScoringContext(rung1, dir)).toBe('ctx.i'); + expect(readFileSync(join(dir, 'ctx.i'), 'utf8')).toBe(rung1); + expect(readFileSync(join(dir, 'ctx.i'), 'utf8')).not.toContain('u32 thunk(void);'); + }); + }); + + test('the generated compile command concatenates ctx.i ahead of the candidate', () => { + inDir((dir) => { + writeScoreConfig('agbcc', dir, undefined, 'ctx.i'); + const doc = YAML.parse(readFileSync(join(dir, 'decomp.yaml'), 'utf8')) as Doc; + expect(doc.tools.asmlift.compiler).toBe( + 'cat ctx.i {{inputPath}} > {{inputPath}}.ctx.c && ' + + renderScoreCommand('agbcc').replaceAll('{{inputPath}}', '{{inputPath}}.ctx.c'), + ); + }); + }); + + test('every toolchain template stays substitutable after the wrap (placeholders intact)', () => { + inDir((dir) => { + for (const id of ['agbcc', 'ido7.1', 'gcc2.7.2', 'gcc2.7.2kmc'] as const) { + writeScoreConfig(id, dir, undefined, 'ctx.i'); + const doc = YAML.parse(readFileSync(join(dir, 'decomp.yaml'), 'utf8')) as Doc; + expect(doc.tools.asmlift.compiler, id).toContain('{{inputPath}}'); + expect(doc.tools.asmlift.compiler, id).toContain('{{outputPath}}'); + expect(doc.tools.asmlift.compiler, id).toContain('cat ctx.i {{inputPath}}'); + } + }); + }); +}); diff --git a/apps/benchmark/test/fidelity-materialize.test.ts b/apps/benchmark/test/fidelity-materialize.test.ts new file mode 100644 index 00000000..e95486c8 --- /dev/null +++ b/apps/benchmark/test/fidelity-materialize.test.ts @@ -0,0 +1,41 @@ +// The fidelity gate runs the PUBLISHED scripts with only the user placeholders filled in — +// this pins that substitution, especially the symbol-fed rows' PROJECT_PATH checkout +// placeholder (whatever repoDir it names) landing as the resolved project root. +import { describe, expect, test } from 'vitest'; + +import { M2C_DIR, REPO_ROOT } from '../src/config'; +import { materialize } from '../src/run/fidelity'; + +const SCRIPT = `#!/usr/bin/env bash +M2C_PATH='/path/to/m2c' +ASMLIFT_PATH='/path/to/asmlift' +PROJECT_PATH='/path/to/klonoa-empire-of-dreams' +pnpm --dir "$ASMLIFT_PATH" bench target kleod:Foo:agbcc --out "$PWD" --project-root "$PROJECT_PATH" 1>&2 +`; + +describe('fidelity materialize', () => { + test('fills every placeholder: m2c + asmlift checkouts, and the project root when given', () => { + const s = materialize(SCRIPT, '/tmp/checkouts/klonoa-empire-of-dreams'); + expect(s).toContain(`M2C_PATH='${M2C_DIR}'`); + expect(s).toContain(`ASMLIFT_PATH='${REPO_ROOT}'`); + expect(s).toContain(`PROJECT_PATH='/tmp/checkouts/klonoa-empire-of-dreams'`); + expect(s).not.toContain('/path/to/'); + }); + + test('substitutes the placeholder regardless of the repoDir it names', () => { + const other = SCRIPT.replace( + "PROJECT_PATH='/path/to/klonoa-empire-of-dreams'", + "PROJECT_PATH='/path/to/marioparty3'", + ); + expect(materialize(other, '/roots/mp3')).toContain("PROJECT_PATH='/roots/mp3'"); + }); + + test('without a project root the placeholder stays — bench target then warns and runs map-less', () => { + expect(materialize(SCRIPT)).toContain("PROJECT_PATH='/path/to/klonoa-empire-of-dreams'"); + }); + + test('never touches scripts without the placeholder', () => { + const plain = "ASMLIFT_PATH='/path/to/asmlift'\n"; + expect(materialize(plain, '/roots/x')).toBe(`ASMLIFT_PATH='${REPO_ROOT}'\n`); + }); +}); diff --git a/apps/benchmark/test/quality.test.ts b/apps/benchmark/test/quality.test.ts index e45c3f72..745a945e 100644 --- a/apps/benchmark/test/quality.test.ts +++ b/apps/benchmark/test/quality.test.ts @@ -35,6 +35,26 @@ describe('assessQuality (pinned)', () => { expect(q).toEqual({ score: 90, lines: 3, gotos: 0, casts: 5, unkGlue: 0, rawMem: 1, addrDeref: 0 }); }); + test('project-idiom address casts are exempt: (u32)&Sym, (s32)&Sym, (u32)Func', () => { + const q = assessQuality( + 'void f(u32 a0) {\n' + // (the parameter-list `(void)` artifact would count — irrelevant here) + ' if ((u32)&gBgInfo == (u32)&GwCommon + 4) {\n' + + ' DoThing((s32)&gDefaultFontPalette < 0, (u32)thunk_sub_080002A0);\n' + + ' }\n' + + '}\n', + ); + expect(q.casts).toBe(0); // all four are the correct address spelling, not cast noise + expect(q.score).toBe(100); + }); + + test('u32 casts of generic locals and of call RESULTS stay counted', () => { + // (u32)a0 / (u32)var_x truncate a LOCAL value; (u32)DoThing(1) casts a call result — + // none of them is an address spelling, so all three still count (plus (s16)2 = 4 > 2). + const q = assessQuality('u32 f(s32 a0) {\n return (u32)a0 + (u32)var_x + (u32)DoThing(1) + (s16)2;\n}\n'); + expect(q.casts).toBe(4); + expect(q.score).toBe(96); + }); + test('absolute-address derefs are counted but not score-penalized', () => { const q = assessQuality('void f(void) {\n *(vu16 *)0x04000052 = 0x100;\n}\n'); expect(q.addrDeref).toBe(1); diff --git a/apps/benchmark/test/real-manifests.test.ts b/apps/benchmark/test/real-manifests.test.ts index f0987246..1635045b 100644 --- a/apps/benchmark/test/real-manifests.test.ts +++ b/apps/benchmark/test/real-manifests.test.ts @@ -25,6 +25,9 @@ describe('committed real-tier manifests', () => { expect(raw).not.toMatch(/\/Users\/|\/home\/|\/opt\/|\/var\/|\/private\/|[A-Z]:\\\\/); // repoDir is a bare directory name, not a path expect(man.repoDir).not.toMatch(/^[/.]/); + // every real project pins its benchmark fork + integration branch (bench setup clones it) + expect(man.repo, `${f}: repo must be owner/name`).toMatch(/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/); + expect(man.branch, `${f}: pinned branch`).toBe('asmlift-benchmark'); // include flags must be project-relative, never absolute for (const flag of man.cppIncludes) { expect(flag, `absolute include flag in ${f}`).not.toMatch(/^\/|-I\//); diff --git a/apps/benchmark/test/repro-scripts.test.ts b/apps/benchmark/test/repro-scripts.test.ts index b28c1dee..5430f952 100644 --- a/apps/benchmark/test/repro-scripts.test.ts +++ b/apps/benchmark/test/repro-scripts.test.ts @@ -137,11 +137,80 @@ describe('asmliftScript (pinned)', () => { } }); - test('real rows carry the context-scoring caveat; synthetic rows do not', () => { - const real = rows.find((r) => r.tier === 'real'); - if (real) { - expect(asmliftScript(real)).toContain('real tier:'); + test('real rows state the ctx-world scoring (step 1 materializes the vendored context)', () => { + const real = rows.filter((r) => r.tier === 'real'); + expect(real.length).toBeGreaterThan(0); + for (const fn of real) { + const s = asmliftScript(fn); + expect(s, fn.id).toContain('real tier:'); + expect(s, fn.id).toContain('ctx.i'); // the materialized scoring context is named + // the old "may grade differently" caveat is gone — scoring now happens IN the ctx world + expect(s, fn.id).not.toContain('may grade'); + } + const synth = asmliftScript(row('synthetic:add:ido7.1')); + expect(synth).not.toContain('real tier:'); + expect(synth).not.toContain('ctx.i'); + }); + + test('real rows state the pinned-checkout recipe with real commands (comments only)', () => { + const real = rows.filter((r) => r.tier === 'real'); + expect(real.length).toBeGreaterThan(0); + for (const fn of real) { + const s = asmliftScript(fn); + expect(s, fn.id).toMatch(/#\s+git clone --branch asmlift-benchmark https:\/\/github\.com\/[\w.-]+\/[\w.-]+\.git/); + expect(s, fn.id).toMatch(/#\s+make -C /); + // the recipe must be COMMENTS — the script itself stays checkout-free + expect(s, fn.id).not.toMatch(/^git clone/m); + } + // sidecar projects additionally derive the symbols ELF + const sidecar = real.find((r) => r.project === 'marioparty3'); + if (sidecar) { + expect(asmliftScript(sidecar)).toContain('make -C marioparty3 asmlift-elf'); + } + expect(asmliftScript(row('synthetic:add:ido7.1'))).not.toContain('git clone --branch'); + }); + + test('symbol-fed rows carry the vendored-map provenance; map-free rows state none is needed', () => { + const withMap = rows.filter((r) => r.asmlift.symbolMap); + expect(withMap.length).toBeGreaterThan(0); // the dataset does carry symbol-fed rows + for (const fn of withMap) { + const s = asmliftScript(fn); + expect(s, fn.id).toContain(`apps/benchmark/dataset/real/tu/${fn.project}/symbols.json.gz`); + expect(s, fn.id).toMatch(/sha256 of the decompressed map JSON: [0-9a-f]{64}/); + expect(s, fn.id).toContain('decomp.yaml (tools.asmlift.elf)'); + } + const noMap = rows.find((r) => r.tier === 'real' && !r.asmlift.symbolMap); + if (noMap) { + const s = asmliftScript(noMap); + expect(s).toContain('no symbols needed'); + expect(s).not.toContain('sha256 of the decompressed map JSON'); + } + expect(asmliftScript(row('synthetic:add:ido7.1'))).not.toContain('SYMBOLS:'); + }); + + test('symbol-fed rows LOAD the map: PROJECT_PATH placeholder + --project-root on the pre-step', () => { + const withMap = rows.filter((r) => r.asmlift.symbolMap); + expect(withMap.length).toBeGreaterThan(0); + for (const fn of withMap) { + const s = asmliftScript(fn); + // the placeholder names the same checkout dir the clone recipe creates + const dir = /^#\s+git clone --branch \S+ \S+\.git (\S+)$/m.exec(s)?.[1]; + expect(dir, fn.id).toBeTruthy(); + expect(s, fn.id).toContain(`PROJECT_PATH='/path/to/${dir}'`); + expect(s, fn.id).toContain(`bench target ${fn.id} --out "$PWD" --project-root "$PROJECT_PATH" 1>&2`); + // the old "standalone run does NOT load it" caveat is gone — the script loads the map now + expect(s, fn.id).not.toContain('does NOT load'); + } + // kleod's repoDir differs from its GitHub repo name — the placeholder must use repoDir + const kleod = withMap.find((r) => r.project === 'kleod'); + if (kleod) { + expect(asmliftScript(kleod)).toContain("PROJECT_PATH='/path/to/klonoa-empire-of-dreams'"); + } + // map-free rows keep the plain pre-step and no placeholder + for (const fn of rows.filter((r) => !r.asmlift.symbolMap)) { + const s = asmliftScript(fn); + expect(s, fn.id).not.toContain('PROJECT_PATH'); + expect(s, fn.id).not.toContain('--project-root'); } - expect(asmliftScript(row('synthetic:add:ido7.1'))).not.toContain('real tier:'); }); }); diff --git a/apps/benchmark/test/setup-checkout.test.ts b/apps/benchmark/test/setup-checkout.test.ts new file mode 100644 index 00000000..0c25d874 --- /dev/null +++ b/apps/benchmark/test/setup-checkout.test.ts @@ -0,0 +1,224 @@ +// Pins for `bench setup` + checkout pinning: manifest repo/branch validation, and setup's +// NEVER-MUTATE rule for existing checkouts (the maintainer's checkouts carry WIP — a harness +// command must not touch them). Remote lookups are stubbed — no network in CI. +import { execSync } from 'node:child_process'; +import { mkdirSync, mkdtempSync, readFileSync, readdirSync, rmSync, writeFileSync } from 'node:fs'; +import { tmpdir } from 'node:os'; +import { join } from 'node:path'; +import { afterEach, describe, expect, test } from 'vitest'; + +import { checkoutStatus } from '../src/cases/checkout'; +import { type RealManifest, benchCheckoutsDir, resolveProjectRoot, validateManifest } from '../src/cases/manifests'; +import { setupProject } from '../src/cases/setup'; +import { WORKSPACE } from '../src/config'; + +const base: RealManifest = { + project: 'fakeproj', + toolchain: 'agbcc', + repoDir: 'fakeproj', + repo: 'macabeus/fakeproj', + branch: 'asmlift-benchmark', + cppIncludes: [], + headers: [], + functions: [{ sym: 'f', features: [], funcC: 'int f(void) { return 1; }' }], +}; + +describe('validateManifest: repo/branch pins', () => { + test('a well-formed manifest validates', () => { + expect(validateManifest(base, 'x.json')).toEqual([]); + }); + + test('repo must be owner/name — URLs and malformed values fail', () => { + for (const repo of ['https://github.com/macabeus/af', 'github.com/macabeus/af', 'af', 'a/b/c', '', undefined]) { + const problems = validateManifest({ ...base, repo }, 'x.json'); + expect(problems.join('\n'), JSON.stringify(repo)).toContain('"repo" must be a GitHub owner/name'); + } + }); + + test('branch must be a non-empty string', () => { + for (const branch of ['', undefined, 42]) { + const problems = validateManifest({ ...base, branch }, 'x.json'); + expect(problems.join('\n'), JSON.stringify(branch)).toContain('"branch" must be a non-empty string'); + } + }); + + test('elfMake, when present, must be a non-empty string', () => { + expect(validateManifest({ ...base, elfMake: 'asmlift-elf' }, 'x.json')).toEqual([]); + expect(validateManifest({ ...base, elfMake: '' }, 'x.json').join('\n')).toContain('"elfMake"'); + }); +}); + +describe('checkout resolution order: env override > bench-owned > sibling WORKSPACE', () => { + const dirs: string[] = []; + const scratch = (): string => { + const d = mkdtempSync(join(tmpdir(), 'asmlift-resolve-test-')); + dirs.push(d); + return d; + }; + afterEach(() => { + delete process.env.ASMLIFT_PROJ_FAKEPROJ; + delete process.env.ASMLIFT_BENCH_CHECKOUTS; + for (const d of dirs.splice(0)) { + rmSync(d, { recursive: true, force: true }); + } + }); + + test('sibling WORKSPACE dir is the fallback when nothing else exists', () => { + process.env.ASMLIFT_BENCH_CHECKOUTS = scratch(); // empty — no bench-owned checkout + expect(resolveProjectRoot(base)).toBe(join(WORKSPACE, 'fakeproj')); + }); + + test('a present bench-owned checkout wins over the sibling dir', () => { + const checkouts = scratch(); + process.env.ASMLIFT_BENCH_CHECKOUTS = checkouts; + mkdirSync(join(checkouts, 'fakeproj')); + expect(resolveProjectRoot(base)).toBe(join(checkouts, 'fakeproj')); + expect(benchCheckoutsDir()).toBe(checkouts); + }); + + test('the ASMLIFT_PROJ_* env override wins over everything', () => { + const checkouts = scratch(); + process.env.ASMLIFT_BENCH_CHECKOUTS = checkouts; + mkdirSync(join(checkouts, 'fakeproj')); + process.env.ASMLIFT_PROJ_FAKEPROJ = '/somewhere/else'; + expect(resolveProjectRoot(base)).toBe('/somewhere/else'); + }); +}); + +describe('bench setup clones into the bench-owned workspace', () => { + const dirs: string[] = []; + const scratch = (): string => { + const d = mkdtempSync(join(tmpdir(), 'asmlift-benchowned-test-')); + dirs.push(d); + return d; + }; + afterEach(() => { + delete process.env.ASMLIFT_PROJ_FAKEPROJ; + delete process.env.ASMLIFT_BENCH_CHECKOUTS; + for (const d of dirs.splice(0)) { + rmSync(d, { recursive: true, force: true }); + } + }); + + test('with no env override, the clone target is the bench-owned dir — never the sibling', () => { + const checkouts = scratch(); + process.env.ASMLIFT_BENCH_CHECKOUTS = checkouts; + const cloned: string[] = []; + const row = setupProject( + base, + () => 'f'.repeat(40), + (repo, branch, dir) => { + cloned.push(`${repo}#${branch} -> ${dir}`); + mkdirSync(dir, { recursive: true }); + writeFileSync(join(dir, 'decomp.yaml'), 'name: fake\n'); + }, + ); + expect(cloned).toEqual([`macabeus/fakeproj#asmlift-benchmark -> ${join(checkouts, 'fakeproj')}`]); + expect(row.action).toBe('cloned'); + expect(row.dir).toBe(join(checkouts, 'fakeproj')); + }); + + test('an existing bench-owned checkout with no recipe is kept as-is (no clone, no writes)', () => { + const checkouts = scratch(); + process.env.ASMLIFT_BENCH_CHECKOUTS = checkouts; + const owned = join(checkouts, 'fakeproj'); + mkdirSync(owned); + writeFileSync(join(owned, 'a-file.txt'), 'kept\n'); + const before = readdirSync(owned, { recursive: true }).map(String).sort().join('\n'); + const row = setupProject( + base, + () => 'f'.repeat(40), + () => { + throw new Error('clone must not run'); + }, + ); + expect(row.action).toBe('kept'); + expect(readdirSync(owned, { recursive: true }).map(String).sort().join('\n')).toBe(before); + }); +}); + +describe('bench setup never mutates an existing checkout', () => { + const dirs: string[] = []; + const scratch = (): string => { + const d = mkdtempSync(join(tmpdir(), 'asmlift-setup-test-')); + dirs.push(d); + return d; + }; + afterEach(() => { + delete process.env.ASMLIFT_PROJ_FAKEPROJ; + for (const d of dirs.splice(0)) { + rmSync(d, { recursive: true, force: true }); + } + }); + + const snapshot = (dir: string): string => readdirSync(dir, { recursive: true }).map(String).sort().join('\n'); + + test('an existing NON-git dir is reported, not cloned into', () => { + const dir = join(scratch(), 'fakeproj'); + mkdirSync(dir); + writeFileSync(join(dir, 'WIP-marker.txt'), 'precious work in progress\n'); + process.env.ASMLIFT_PROJ_FAKEPROJ = dir; + const before = snapshot(dir); + const row = setupProject(base, () => 'f'.repeat(40)); // stubbed remote — must not even be needed + expect(row.action).toBe('kept'); + expect(snapshot(dir)).toBe(before); + expect(readFileSync(join(dir, 'WIP-marker.txt'), 'utf8')).toContain('precious'); + expect(row.notes.join(' ')).toContain('not a git checkout'); + }); + + test('an existing git checkout keeps its HEAD and worktree even when it drifted from the pin', () => { + const dir = join(scratch(), 'fakeproj'); + mkdirSync(dir); + const g = (args: string) => + execSync(`git -C ${JSON.stringify(dir)} ${args}`, { + encoding: 'utf8', + env: { + ...process.env, + GIT_AUTHOR_NAME: 't', + GIT_AUTHOR_EMAIL: 't@t', + GIT_COMMITTER_NAME: 't', + GIT_COMMITTER_EMAIL: 't@t', + }, + }).trim(); + g('init -q'); + writeFileSync(join(dir, 'file.c'), 'int wip;\n'); + g('add file.c'); + g('commit -qm base'); + const head = g('rev-parse HEAD'); + writeFileSync(join(dir, 'file.c'), 'int wip2; /* uncommitted */\n'); + process.env.ASMLIFT_PROJ_FAKEPROJ = dir; + + const remoteHead = 'a'.repeat(40); // deliberately != local HEAD + const row = setupProject(base, () => remoteHead); + expect(row.action).toBe('kept'); + expect(row.head).toBe(head); + expect(row.remoteHead).toBe(remoteHead); + expect(row.dirty).toBe(true); + expect(row.notes.join(' ')).toContain('HEAD !='); + // the checkout itself is untouched: same HEAD, same uncommitted WIP + expect(g('rev-parse HEAD')).toBe(head); + expect(readFileSync(join(dir, 'file.c'), 'utf8')).toContain('uncommitted'); + }); + + test('checkoutStatus itself is read-only and reports offline provenance state', () => { + const dir = join(scratch(), 'fakeproj'); + mkdirSync(dir); + const env = { + ...process.env, + GIT_AUTHOR_NAME: 't', + GIT_AUTHOR_EMAIL: 't@t', + GIT_COMMITTER_NAME: 't', + GIT_COMMITTER_EMAIL: 't@t', + }; + execSync(`git -C ${JSON.stringify(dir)} init -q`, { env }); + writeFileSync(join(dir, 'f'), 'x\n'); + execSync(`git -C ${JSON.stringify(dir)} add f`, { env }); + execSync(`git -C ${JSON.stringify(dir)} commit -qm base`, { env }); + process.env.ASMLIFT_PROJ_FAKEPROJ = dir; + const before = snapshot(dir); + const st = checkoutStatus(base, () => null); // offline: remote unreachable + expect(st.present).toBe(true); + expect(st.remoteHead).toBeNull(); + expect(snapshot(dir)).toBe(before); + }); +}); diff --git a/apps/benchmark/test/symbol-drift.test.ts b/apps/benchmark/test/symbol-drift.test.ts new file mode 100644 index 00000000..13a5ee4d --- /dev/null +++ b/apps/benchmark/test/symbol-drift.test.ts @@ -0,0 +1,36 @@ +// Pins for the fidelity symbol-map drift check: the comparison is over the DECOMPRESSED JSON +// bytes (gzip envelopes never participate), equal maps pass, and any byte of drift is named. +import { symbolMapFromJson, symbolMapToJson } from '@asmlift/core/symbols'; +import { gunzipSync, gzipSync } from 'node:zlib'; +import { describe, expect, test } from 'vitest'; + +import { symbolMapDrift } from '../src/run/symbol-drift'; + +// a small fixture map in the exact shape vendor writes (symbolMapToJson output) +const fixture = JSON.stringify({ + '0x03001000': [{ name: 'gPlayer', kind: 'data', declared: true, shape: 'struct', size: 88 }], + '0x08012345': [{ name: 'UpdatePlayer', kind: 'code' }], +}); + +describe('symbolMapDrift', () => { + test('identical decompressed JSON ⇒ no drift, regardless of gzip settings', () => { + // two DIFFERENT gzip envelopes of the same JSON (level 1 vs 9) must still compare equal + const a = gunzipSync(gzipSync(Buffer.from(fixture), { level: 1 })).toString('utf8'); + const b = gunzipSync(gzipSync(Buffer.from(fixture), { level: 9 })).toString('utf8'); + expect(symbolMapDrift(a, b)).toBeNull(); + }); + + test('a one-symbol difference is drift, named by both hashes', () => { + const drifted = fixture.replace('UpdatePlayer', 'UpdatePlayer2'); + const reason = symbolMapDrift(fixture, drifted); + expect(reason).toContain('vendored map sha256'); + expect(reason).toContain('!= re-derived'); + }); + + test('the vendor round-trip is byte-stable (fromJson→toJson reproduces the vendored bytes)', () => { + // the drift check relies on this: re-deriving via symbolMapToJson must reproduce the + // exact bytes vendor wrote for an unchanged ELF + const roundTripped = JSON.stringify(symbolMapToJson(symbolMapFromJson(JSON.parse(fixture)))); + expect(symbolMapDrift(fixture, roundTripped)).toBeNull(); + }); +}); diff --git a/apps/benchmark/test/symbols-used.test.ts b/apps/benchmark/test/symbols-used.test.ts new file mode 100644 index 00000000..bb615049 --- /dev/null +++ b/apps/benchmark/test/symbols-used.test.ts @@ -0,0 +1,172 @@ +// symbolsUsed / candidateLabel PROVENANCE CAPTURE (eval/asmlift.ts): a scored row records which +// candidate spelling won the differ and — on map rows — every map symbol the winner's output +// references, shape pre-formatted for the report. The ranking itself is mocked (no compiler in +// this suite); the refs it hands back are REAL — derived by core's enumeration from the exact +// tree each spelling was emitted from, so the call-target exclusion is exercised, not simulated. +import type { CandidateCompiler } from '@asmlift/cli/compile-command'; +import { decompileRanked } from '@asmlift/cli/rank'; +import type { MatchScore } from '@asmlift/cli/score'; +import { decompile } from '@asmlift/core/pipeline'; +import { enumerateCandidates } from '@asmlift/core/rank'; +import type { SymbolInfo, SymbolMap } from '@asmlift/core/symbols'; +import { ARMV4T_AGBCC } from '@asmlift/core/target'; +import { describe, expect, test, vi } from 'vitest'; + +import { runAsmlift, symbolShape, symbolsUsedFrom } from '../src/eval/asmlift'; +import type { Toolchain } from '../src/toolchains'; + +vi.mock('@asmlift/cli/rank', () => ({ decompileRanked: vi.fn() })); +// Real decompile, but call-countable — pins the backstop's RETIREMENT (exactly ONE phase-1 +// decompile per row; the old retry-without-map second call must never come back). +vi.mock('@asmlift/core/pipeline', async (importOriginal) => { + const actual = await importOriginal(); + return { ...actual, decompile: vi.fn(actual.decompile) }; +}); + +const ranked = vi.mocked(decompileRanked); + +const TC = { id: 'agbcc', targetDesc: ARMV4T_AGBCC } as Toolchain; +// the ranking is mocked, so the candidate compiler must never run +const noCompile = (() => { + throw new Error('candidate compile must not run in this suite'); +}) as unknown as CandidateCompiler; + +const SCORE: MatchScore = { + symbol: 'f', + score: 3, + match: false, + rows: 10, + matching: 7, + breakdown: { insert: 0, delete: 0, replace: 0, opMismatch: 3, argMismatch: 0 }, +}; + +/** Rank-for-real minus the scorer: enumerate the true candidates, pick by label predicate. */ +function rankPicking(pick: (label: string) => boolean): void { + ranked.mockImplementation((name, asm, target, _obj, opts) => { + const cands = enumerateCandidates(name, asm, target, opts); + const cand = cands.find((c) => pick(c.label)); + if (!cand) { + throw new Error(`no candidate matches the pick among: ${cands.map((c) => c.label).join(', ')}`); + } + const scored = { ...cand, score: SCORE }; + return { best: scored, candidates: [scored], dropped: [] }; + }); +} + +// ldr rN, =0x03001234; load a halfword through it — promotes to the mapped name +const LOADH = 'f:\n\tldr\tr0, .L1\n\tldrh\tr0, [r0]\n\tbx\tlr\n.L1:\n\t.word\t0x03001234\n'; +const COUNTER: SymbolInfo = { name: 'gCounter', kind: 'data', shape: 'scalar', size: 2, signed: false }; +const MAP: SymbolMap = new Map([[0x03001234, [COUNTER]]]); + +describe('symbolsUsed / candidateLabel capture (pinned)', () => { + test('a symbol-fed row records the winning refs with pre-formatted shapes, plus the label', () => { + rankPicking((l) => !l.includes('/raw-globals')); + const r = runAsmlift(TC, 'f', LOADH, '/nonexistent.o', undefined, noCompile, MAP); + expect(r.outcome).toBe('nonmatch'); + expect(r.symbolMap).toBe(true); + expect(r.symbolsUsed).toEqual([{ name: 'gCounter', shape: 'scalar u16' }]); + expect(r.candidateLabel).toBeDefined(); + expect(r.candidateLabel).not.toContain('/raw-globals'); + }); + + test('a CALL target is never recorded, even alongside a recorded data ref', () => { + const body = + 'f:\n\tpush\t{lr}\n\tbl\tDoThing\n\tldr\tr0, .L1\n\tldrh\tr0, [r0]\n\tpop\t{r1}\n\tbx\tr1\n.L1:\n\t.word\t0x03001234\n'; + const map: SymbolMap = new Map([ + [0x03001234, [COUNTER]], + [0x08001000, [{ name: 'DoThing', kind: 'code' }]], + ]); + rankPicking((l) => !l.includes('/raw-globals')); + const r = runAsmlift(TC, 'f', body, '/nonexistent.o', undefined, noCompile, map); + const names = (r.symbolsUsed ?? []).map((s) => s.name); + expect(names).toContain('gCounter'); + expect(names).not.toContain('DoThing'); // called ⇒ excluded upstream (C89 prototype poison) + }); + + test('a raw-globals winner on a map row ⇒ symbolMap true, symbolsUsed HONESTLY empty', () => { + rankPicking((l) => l.includes('/raw-globals')); + const r = runAsmlift(TC, 'f', LOADH, '/nonexistent.o', undefined, noCompile, MAP); + expect(r.symbolMap).toBe(true); + expect(r.symbolsUsed).toEqual([]); + expect(r.candidateLabel).toContain('/raw-globals'); // the label says which spelling won + }); + + test('no map ⇒ no symbolsUsed field at all; the label still records the winner', () => { + rankPicking(() => true); + const r = runAsmlift(TC, 'f', LOADH, '/nonexistent.o', undefined, noCompile); + expect(r).not.toHaveProperty('symbolMap'); + expect(r).not.toHaveProperty('symbolsUsed'); + expect(r.candidateLabel).toBeDefined(); + }); + + test('an unscored row (noncompile) carries neither provenance field', () => { + ranked.mockImplementation(() => { + throw new Error('error: boom'); + }); + const r = runAsmlift(TC, 'f', LOADH, '/nonexistent.o', undefined, noCompile, MAP); + expect(r.outcome).toBe('noncompile'); + expect(r).not.toHaveProperty('symbolsUsed'); + expect(r).not.toHaveProperty('candidateLabel'); + }); + + test('BACKSTOP RETIRED: a gapped map row declines WITH the map — one decompile, no retry, no fell-back marker', () => { + // (schema-historical) is never set. + const gapped = 'f:\n\tclz\tr0, r0\n\tbx\tlr\n'; + vi.mocked(decompile).mockClear(); + const r = runAsmlift(TC, 'f', gapped, '/nonexistent.o', undefined, noCompile, MAP); + expect(r.outcome).toBe('declined'); + expect(r.symbolMap).toBe(true); + expect(decompile).toHaveBeenCalledTimes(1); + }); +}); + +describe('symbolShape formatting (pinned)', () => { + const cases: [SymbolInfo, string | undefined][] = [ + [{ name: 'g', kind: 'data', shape: 'struct', structName: 'Unk_03004C20', size: 24 }, 'struct Unk_03004C20 (24 B)'], + [{ name: 'g', kind: 'data', shape: 'struct', size: 8 }, 'struct ? (8 B)'], + [{ name: 'g', kind: 'data', shape: 'array', elemSize: 2 }, 'u16[]'], + [{ name: 'g', kind: 'data', shape: 'array', elemSize: 1, elemSigned: true }, 's8[]'], + // a struct-element array must not masquerade as a giant int type (kleod gBgInfo is 28 B/elem) + [{ name: 'g', kind: 'data', shape: 'array', elemSize: 28 }, 'array (28 B/elem)'], + [{ name: 'g', kind: 'data', shape: 'scalar', size: 1 }, 'scalar u8'], + [{ name: 'g', kind: 'data', shape: 'scalar', size: 12 }, 'scalar (12 B)'], + [{ name: 'g', kind: 'data', shape: 'scalar', size: 4, signed: true }, 'scalar s32'], + [{ name: 'g', kind: 'data', shape: 'pointer' }, 'pointer'], + [{ name: 'F', kind: 'code' }, 'code'], + [{ name: 'g', kind: 'data' }, undefined], // name-only symbol: no shape claim + ]; + test.each(cases)('%o → %s', (info, want) => { + expect(symbolShape(info)).toBe(want); + }); + + test('symbolsUsedFrom sorts by name and omits absent shapes', () => { + const used = symbolsUsedFrom([ + { name: 'gZeta', info: { name: 'gZeta', kind: 'data' } }, + { name: 'gAlpha', info: COUNTER }, + ]); + expect(used).toEqual([{ name: 'gAlpha', shape: 'scalar u16' }, { name: 'gZeta' }]); + expect(used[1]).not.toHaveProperty('shape'); + }); +}); + +describe('dropped candidates are recorded, never silently swallowed', () => { + test('a spelling that failed to build is published with its diagnostic', () => { + ranked.mockImplementation((name, asm, target, _obj, opts) => { + const cands = enumerateCandidates(name, asm, target, opts); + const scored = { ...cands[0], score: SCORE }; + return { + best: scored, + candidates: [scored], + dropped: [{ label: 'unsigned', error: "too many arguments to `thunk_sub_080002A0'" }], + }; + }); + const r = runAsmlift(TC, 'f', LOADH, 'obj', undefined, noCompile, MAP); + expect(r.outcome).toBe('nonmatch'); + expect(r.droppedCandidates).toEqual([{ label: 'unsigned', error: "too many arguments to `thunk_sub_080002A0'" }]); + }); + + test('every candidate building ⇒ the field is absent, not an empty array', () => { + rankPicking(() => true); + expect(runAsmlift(TC, 'f', LOADH, 'obj', undefined, noCompile, MAP)).not.toHaveProperty('droppedCandidates'); + }); +}); diff --git a/apps/web/src/data/summary.json b/apps/web/src/data/summary.json index b285b2d1..78e3bbca 100644 --- a/apps/web/src/data/summary.json +++ b/apps/web/src/data/summary.json @@ -4,7 +4,7 @@ "asmlift": 343, "m2c": 340 }, - "commit": "ba104d0d8566fa496f7b1cacfa2eaa1a3e53ae07", + "commit": "f309fec083fbc669836a6aea250dcea84532eecd", "m2cCommit": "94098d4de68c2fcc13fb8cf1096a1520eb171abe", "dirty": false } diff --git a/apps/web/src/pages/benchmark/components/Explorer.tsx b/apps/web/src/pages/benchmark/components/Explorer.tsx index a25d2995..7393fdec 100644 --- a/apps/web/src/pages/benchmark/components/Explorer.tsx +++ b/apps/web/src/pages/benchmark/components/Explorer.tsx @@ -104,6 +104,9 @@ export function Explorer({ if (filters.decline && !declineClassesOf(r).includes(filters.decline)) { return false; } + if (filters.symbols === 'with' && !r.asmlift.symbolMap) { + return false; + } if (q && !r.sym.toLowerCase().includes(q)) { return false; } @@ -261,6 +264,17 @@ export function Explorer({ onChange={(v) => set({ feature: v })} options={[{ value: '', label: 'All' }, ...features.map((f) => ({ value: f, label: f }))]} /> + + {open && ( +

+ + {protoEntries.length > 0 ? ( +
+ {protoEntries.map(([name, hint]) => ( + + {name} {protoHintLabel(hint)} + + ))} +
+ ) : ( + none + )} +
+ + {fn.ctxRef ? ( + + {fn.ctxRef} (vendored project headers, via --context) + + ) : fn.ctx ? ( + + inline context header ({fn.ctx.split('\n').length} lines, via --context) + + ) : ( + signature only + )} + + + {r.symbolMap && scored ? ( + symbols.length > 0 ? ( + + used — the winning candidate references {symbols.length} map symbol{symbols.length === 1 ? '' : 's'} + + ) : ( + present, unused — the winning spelling named none of its symbols + ) + ) : ( + // no map, OR a declined/failed map row (no winner exists → no usage claim) + none + )} + {symbols.length > 0 && ( +
+ {symbols.map((s) => ( + + {s.name} + {s.shape && {s.shape}} + + ))} +
+ )} + {r.candidateLabel && ( +
+ winner: {r.candidateLabel} +
+ )} +
+
+ )} + + ); +} + /** Right-hand detail drawer for a selected function. */ export function FunctionDetail({ fn, @@ -234,6 +374,9 @@ export function FunctionDetail({ const share = useMemo(() => playgroundShare(fn), [fn]); const [m2cPath, setM2cPath] = usePersistedPath(PATH_STORAGE_KEYS.m2c); const [asmliftPath, setAsmliftPath] = usePersistedPath(PATH_STORAGE_KEYS.asmlift); + // symbol-fed rows only: the decomp-project checkout, persisted per project + const [projectPath, setProjectPath] = usePersistedPath(`${PATH_STORAGE_KEYS.project}:${fn.project}`); + const projectDefault = fn.scripts ? projectPlaceholder(fn.scripts.asmlift) : null; useEffect(() => { const onKey = (e: KeyboardEvent) => { @@ -359,21 +502,34 @@ export function FunctionDetail({ onChange={setAsmliftPath} placeholder="/path/to/asmlift" /> + {projectDefault && ( + // only symbol-fed rows carry the placeholder: the BUILT decomp-project + // checkout the asmlift script loads the symbol map from + + )} )} + + {/* Everything the decompilers were given as input, in one collapsed place. */} + diff --git a/apps/web/src/pages/benchmark/components/Methodology.tsx b/apps/web/src/pages/benchmark/components/Methodology.tsx index dcf584a8..cf3c3684 100644 --- a/apps/web/src/pages/benchmark/components/Methodology.tsx +++ b/apps/web/src/pages/benchmark/components/Methodology.tsx @@ -99,6 +99,19 @@ export function Methodology({ rows }: { rows: FunctionResult[] }) { contexts contain exactly what the project declares, never authored types. Remaining declines are genuine capability gaps on both sides.

+

+ asmlift's analogue of that context is the project's symbol map: names and declaration shapes derived + at vendor time from the ELF the project's own decomp.yaml declares ( + .symtab names; struct layouts and array element types from the DWARF + types-sidecar the project links in). The same boundary applies — the map carries exactly what the project's + ldscript and headers declare, never authored knowledge. Rows that ran with a map are flagged{' '} + symbolMap in their provenance, so with-map and without-map rows are never + read as the same experiment. Both spellings (named and raw-address) are candidate-ranked, so the map can + reveal capability but never masks a regression. Each row's detail consolidates all of this in a collapsed{' '} + Provenance section at the bottom: the prototype hints asmlift received, the + context m2c received, and the symbol map's state (used / present-but-unused / none) with every map symbol the + winning candidate references and the candidate spelling that won. +

@@ -134,7 +147,9 @@ export function Methodology({ rows }: { rows: FunctionResult[] }) {

Each output also gets a 0–100 readability score (penalizing gotos, redundant casts, and undecompiled glue — a proxy for how much a human would rewrite), and non-matching functions record their gap size: the best - compiling candidate's objdiff diff. + compiling candidate's objdiff diff. The cast metric exempts project-idiom address casts ( + (u32)&gSymbol, (u32)FuncName) — the + correct C spelling of a link-time address, not noise.

diff --git a/apps/web/src/pages/benchmark/data/results.json b/apps/web/src/pages/benchmark/data/results.json index dbd46392..af73d000 100644 --- a/apps/web/src/pages/benchmark/data/results.json +++ b/apps/web/src/pages/benchmark/data/results.json @@ -1 +1 @@ -{"meta":{"generatedAt":"2026-07-22T14:54:18.341Z","toolchains":["ido7.1","agbcc","gcc2.7.2","gcc2.7.2kmc","mwcc_242_81"],"counts":{"total":675,"synthetic":483,"real":192},"asmlift":{"commit":"ba104d0d8566fa496f7b1cacfa2eaa1a3e53ae07","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/zeldaret/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/zeldaret/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/zeldaret/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/zeldaret/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/zeldaret/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/zeldaret/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/zeldaret/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/zeldaret/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/zeldaret/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/zeldaret/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/zeldaret/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/zeldaret/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/zeldaret/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/zeldaret/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/zeldaret/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/zeldaret/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/zeldaret/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/zeldaret/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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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/zeldaret/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/zeldaret/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/zeldaret/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/zeldaret/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/zeldaret/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/zeldaret/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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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/zeldaret/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/zeldaret/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/zeldaret/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/zeldaret/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/zeldaret/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/zeldaret/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/zeldaret/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/zeldaret/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/macabeus/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","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":11,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:1076: conflicting types for `gUnk_03004D80'","/c.c:563: previous declaration of `gUnk_03004D80'","/c.c:1086: `unksp0' undeclared (first use in this function)","/c.c:1086: (Each undeclared identifier is reported only once","/c.c:1086: 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/macabeus/kl-eod-decomp/blob/ebe9bd0eccaa3a763a96321af92e17fdede003c4/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","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:1071: conflicting types for `gUnk_03004670'","/c.c:312: previous declaration of `gUnk_03004670'","/c.c:1086: warning: dereferencing `void *' pointer","/c.c:1086: void value not ignored as it ought to be","/c.c:1089: 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/macabeus/kl-eod-decomp/blob/ebe9bd0eccaa3a763a96321af92e17fdede003c4/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-f8b523f02efa.i.gz","asmlift":{"decompiler":"asmlift","outcome":"noncompile","source":"s32 CopyBGScrollTiles(void) {\n s32 v0;\n u32 v1;\n s32 v2;\n v1 = 0;\n do {\n if (v1 >= gUnk_03005220 << 30 >> 30) {\n v2 = 2;\n } else {\n v2 = 0;\n }\n ((u16 *)&gBgTilemapBufs)[(v1 << 1) + 577] = ((u16 *)&gBgTilemapBufs)[(v1 << 1) + (v2 + 20 << 5)];\n ((u16 *)&gBgTilemapBufs)[(v1 << 1) + 578] = ((u16 *)&gBgTilemapBufs)[(v1 << 1) + ((v2 + 20 << 5) + 1)];\n ((u16 *)&gBgTilemapBufs)[(v1 << 1) + 609] = ((u16 *)&gBgTilemapBufs)[(v1 << 1) + (v2 + 21 << 5)];\n v0 = ((u16 *)&gBgTilemapBufs)[(v1 << 1) + ((v2 + 21 << 5) + 1)];\n ((u16 *)&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":88,"lines":20,"gotos":0,"casts":9,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["no scorable candidate for 'CopyBGScrollTiles': agbcc failed: /c.c:1077: 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:1081: 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-f8b523f02efa.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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/macabeus/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},"thunk_HeapAlloc":{"params":2},"thunk_HeapFree":{"params":1,"returnsVoid":true},"HuffUnComp":{"params":2,"returnsVoid":true},"LZ77UnCompWram":{"params":2,"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","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);\n }\n return;\n}\n","score":12,"maxScore":30,"compileErrors":null,"breakdown":{"insert":4,"delete":4,"replace":1,"opMismatch":1,"argMismatch":2},"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:1074: warning: dereferencing `void *' pointer","/c.c:1074: request for member `unk0' in something not a structure or union","/c.c:1075: warning: implicit declaration of function `thunk_HeapAlloc'","/c.c:1075: warning: dereferencing `void *' pointer","/c.c:1075: request for member `unk4' in something not a structure or union"]},"gapSize":{"decompiler":"asmlift","score":12,"maxScore":30,"ratio":0.4,"kinds":{"insert":4,"delete":4,"replace":1,"opMismatch":1,"argMismatch":2}},"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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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 \"thunk_HeapAlloc\": {\n \"params\": 2\n },\n \"thunk_HeapFree\": {\n \"params\": 1,\n \"returnsVoid\": true\n },\n \"HuffUnComp\": {\n \"params\": 2,\n \"returnsVoid\": true\n },\n \"LZ77UnCompWram\": {\n \"params\": 2,\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/macabeus/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-322c201f79a5.i.gz","proto":{"thunk_HeapAlloc":{"params":2},"Decompress":{"params":2,"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","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:1076: warning: dereferencing `void *' pointer","/c.c:1076: 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-322c201f79a5.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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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 prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"thunk_HeapAlloc\": {\n \"params\": 2\n },\n \"Decompress\": {\n \"params\": 2,\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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 --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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/macabeus/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},"thunk_HeapAlloc":{"params":2},"thunk_HeapFree":{"params":1,"returnsVoid":true},"Decompress":{"params":2,"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","outcome":"nonmatch","source":"void DecompressDma(s32 * a0, u32 a1, u32 a2) {\n s32 v0;\n v0 = thunk_HeapAlloc(*a0 & 2147483647, 0);\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);\n return;\n}\n","score":19,"maxScore":38,"compileErrors":null,"breakdown":{"insert":5,"delete":2,"replace":1,"opMismatch":1,"argMismatch":10},"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:1074: warning: implicit declaration of function `thunk_HeapAlloc'","/c.c:1074: warning: assignment makes pointer from integer without a cast","/c.c:1075: warning: implicit declaration of function `Decompress'","/c.c:1076: invalid type argument of `->'","/c.c:1077: invalid type argument of `->'"]},"gapSize":{"decompiler":"asmlift","score":19,"maxScore":38,"ratio":0.5,"kinds":{"insert":5,"delete":2,"replace":1,"opMismatch":1,"argMismatch":10}},"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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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 \"thunk_HeapAlloc\": {\n \"params\": 2\n },\n \"thunk_HeapFree\": {\n \"params\": 1,\n \"returnsVoid\": true\n },\n \"Decompress\": {\n \"params\": 2,\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/macabeus/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/macabeus/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/macabeus/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","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 = (struct Elem0 *)*(s32 *)50333640;\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":2,"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:1074: warning: assignment makes pointer from integer without a cast","/c.c:1075: invalid type argument of `->'","/c.c:1075: warning: dereferencing `void *' pointer","/c.c:1075: request for member `unk0' in something not a structure or union","/c.c:1075: 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/macabeus/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-afc6f9b0cb86.i.gz","proto":{"FreeAllDecompBuffers":{"returnsVoid":true},"thunk_HeapFree":{"params":1,"returnsVoid":true},"m4aSongNumStart":{"params":1,"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","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:1076: invalid type argument of `->'","/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 `->'"]},"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-afc6f9b0cb86.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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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 \"thunk_HeapFree\": {\n \"params\": 1,\n \"returnsVoid\": true\n },\n \"m4aSongNumStart\": {\n \"params\": 1,\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/macabeus/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},"UpdateWorldMapNodeState":{"params":0,"returnsVoid":true},"UpdatePlayerInput":{"params":0,"returnsVoid":true},"InitPlayerCollision":{"params":0,"returnsVoid":true},"UpdateWorldMapCursor":{"params":0,"returnsVoid":true},"UpdatePaletteAnimations":{"params":0,"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","outcome":"match","source":"void GameUpdate(void) {\n if (*(u8 *)50345188 == 0) {\n UpdateWorldMapNodeState();\n UpdatePlayerInput();\n InitPlayerCollision();\n UpdateWorldMapCursor();\n }\n UpdatePaletteAnimations();\n return;\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":2,"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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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 \"UpdateWorldMapNodeState\": {\n \"params\": 0,\n \"returnsVoid\": true\n },\n \"UpdatePlayerInput\": {\n \"params\": 0,\n \"returnsVoid\": true\n },\n \"InitPlayerCollision\": {\n \"params\": 0,\n \"returnsVoid\": true\n },\n \"UpdateWorldMapCursor\": {\n \"params\": 0,\n \"returnsVoid\": true\n },\n \"UpdatePaletteAnimations\": {\n \"params\": 0,\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/macabeus/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-f8b523f02efa.i.gz","proto":{"GetEntityLookupData":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","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:1074: warning: assignment discards qualifiers from pointer target type","/c.c:1075: request for member `unk11' in something not a structure or union","/c.c:1075: request for member `unk5' in something not a structure or union","/c.c:1076: request for member `unk12' 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":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-f8b523f02efa.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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/macabeus/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/macabeus/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/macabeus/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","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 *)*(s32 *)50352804)[a0].field_3 >> 7 != 0) {\n return 1;\n } else {\n v0 = ((struct Elem0 *)*(s32 *)50352804)[a0].field_20;\n ((struct Elem0 *)*(s32 *)50352804)[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":11,"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:1077: warning: assignment makes pointer from integer without a cast","/c.c:1078: warning: dereferencing `void *' pointer","/c.c:1078: request for member `unk3' in something not a structure or union","/c.c:1078: 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/macabeus/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},"SoftResetRom":{"params":["u8"],"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","outcome":"nonmatch","source":"void ReadKeyInput(void) {\n s32 v0;\n s32 v1;\n u16 * v2;\n v0 = *(u16 *)67109168;\n gKeysPressed = (1023 ^ v0) & ~gKeysPrevious;\n gKeysPrevious = 1023 ^ v0;\n if (((1023 ^ v0) & 15) == 15) SoftResetRom(255);\n v1 = gKeysPrevious;\n if ((1 & v1) == 0) {\n gAButtonHold = 1 & v1;\n } else {\n v2 = gAButtonHold;\n gAButtonHold = v2 + 1;\n }\n return;\n}\n","score":40,"maxScore":54,"compileErrors":null,"breakdown":{"insert":13,"delete":9,"replace":3,"opMismatch":1,"argMismatch":14},"quality":{"score":100,"lines":17,"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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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 \"SoftResetRom\": {\n \"params\": [\n \"u8\"\n ],\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/macabeus/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","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:1072: warning: dereferencing `void *' pointer","/c.c:1072: request for member `unk0' in something not a structure or union","/c.c:1072: 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/macabeus/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","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:1072: warning: dereferencing `void *' pointer","/c.c:1072: request for member `unk0' in something not a structure or union","/c.c:1072: request for member `unk1' in something not a structure or union","/c.c:1072: request for member `unk2' in something not a structure or union","/c.c:1072: 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/macabeus/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/macabeus/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/macabeus/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/macabeus/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","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:1073: conflicting types for `sub_0805193C'","/c.c:1071: previous declaration of `sub_0805193C'","/c.c:1074: conflicting types for `thunk_sub_080002A0'","/c.c:1070: previous declaration of `thunk_sub_080002A0'","/c.c:1079: 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/macabeus/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/macabeus/kl-eod-decomp/blob/ebe9bd0eccaa3a763a96321af92e17fdede003c4/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","outcome":"nonmatch","source":"s32 StreamCmd_SetBGScroll(void) {\n s32 * v0;\n s32 v1;\n s32 v2;\n u8 * v3;\n s32 v4;\n s32 v5;\n u8 * v6;\n v0 = (s32 *)50351492;\n v1 = ReadUnalignedU16(*v0 + 3);\n v2 = 50345008;\n v3 = (u8 *)*v0;\n v4 = v3[2];\n ((u16 *)(v4 * 28 + v2))[4] = v1 << 4;\n v5 = ReadUnalignedU16(v3 + 5, v4 * 28 + v2, v4, v1 << 4);\n v6 = (u8 *)*v0;\n ((u16 *)(v6[2] * 28 + v2))[5] = v5 << 4;\n *v0 = v6 + 7;\n return v5 << 4;\n}\n","score":25,"maxScore":38,"compileErrors":null,"breakdown":{"insert":6,"delete":1,"replace":3,"opMismatch":1,"argMismatch":14},"quality":{"score":92,"lines":20,"gotos":0,"casts":6,"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:1078: warning: dereferencing `void *' pointer","/c.c:1078: request for member `unk2' in something not a structure or union","/c.c:1080: warning: dereferencing `void *' pointer","/c.c:1080: request for member `unk2' in something not a structure or union"]},"gapSize":{"decompiler":"asmlift","score":25,"maxScore":38,"ratio":0.6578947368421053,"kinds":{"insert":6,"delete":1,"replace":3,"opMismatch":1,"argMismatch":14}},"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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/macabeus/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","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:1075: invalid type argument of `->'","/c.c:1075: warning: dereferencing `void *' pointer","/c.c:1075: request for member `unk2' in something not a structure or union","/c.c:1075: request for member `unk3' in something not a structure or union","/c.c:1076: 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/macabeus/kl-eod-decomp/blob/ebe9bd0eccaa3a763a96321af92e17fdede003c4/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/macabeus/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},"CheckWorldCompletion":{"params":["u8"]},"CopyWorldMapTiles":{"params":["u8"],"returnsVoid":true},"UpdateWorldMapNodeTile":{"params":["u8"],"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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 \"CheckWorldCompletion\": {\n \"params\": [\n \"u8\"\n ]\n },\n \"CopyWorldMapTiles\": {\n \"params\": [\n \"u8\"\n ],\n \"returnsVoid\": true\n },\n \"UpdateWorldMapNodeTile\": {\n \"params\": [\n \"u8\"\n ],\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/macabeus/kl-eod-decomp/blob/ebe9bd0eccaa3a763a96321af92e17fdede003c4/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-f8b523f02efa.i.gz","asmlift":{"decompiler":"asmlift","outcome":"nonmatch","source":"s32 UpdateFadeEffect(void) {\n s32 v0;\n s32 v1;\n v0 = sub_08051A0C(*(u8 *)67108870, ((u8 *)&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":6,"maxScore":21,"compileErrors":null,"breakdown":{"insert":1,"delete":1,"replace":0,"opMismatch":0,"argMismatch":4},"quality":{"score":88,"lines":12,"gotos":0,"casts":9,"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:1076: request for member `unk8' in something not a structure or union"]},"gapSize":{"decompiler":"asmlift","score":6,"maxScore":21,"ratio":0.2857142857142857,"kinds":{"insert":1,"delete":1,"replace":0,"opMismatch":0,"argMismatch":4}},"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-f8b523f02efa.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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/macabeus/kl-eod-decomp/blob/ebe9bd0eccaa3a763a96321af92e17fdede003c4/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-f8b523f02efa.i.gz","asmlift":{"decompiler":"asmlift","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 (((u8 *)&gUnk_03004C20)[10] == 1) {\n v2 = 100;\n } else {\n if (((u8 *)&gUnk_03004C20)[12] != 6) {\n v2 = 30;\n } else {\n v2 = 100;\n }\n }\n v0 = gUnk_03005220;\n if (v2 != v0 << 20 >> 25) {\n v3 = 0;\n } else {\n v3 = 1;\n }\n if (((u8 *)&gUnk_03004C20)[10] == 1) {\n if (v0 << 20 >> 25 <= 99) {\n v4 = 1;\n v5 = &gBgTilemapBufs;\n } else {\n ((u16 *)&gBgTilemapBufs)[594] = ((u16 *)&gBgTilemapBufs)[659];\n ((u16 *)&gBgTilemapBufs)[626] = ((u16 *)&gBgTilemapBufs)[691];\n v4 = 1;\n v5 = &gBgTilemapBufs;\n }\n } else {\n if (((u8 *)&gUnk_03004C20)[12] != 6) {\n v4 = 0;\n v5 = &gBgTilemapBufs;\n } else {\n if (v0 << 20 >> 25 <= 99) {\n v4 = 1;\n v5 = &gBgTilemapBufs;\n } else {\n ((u16 *)&gBgTilemapBufs)[594] = ((u16 *)&gBgTilemapBufs)[659];\n ((u16 *)&gBgTilemapBufs)[626] = ((u16 *)&gBgTilemapBufs)[691];\n v4 = 1;\n v5 = &gBgTilemapBufs;\n }\n }\n }\n v1 = 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[(gUnk_03005220 << 20 >> 25) / 10 + 690];\n }\n v5[597 - v4] = v5[(gUnk_03005220 << 20 >> 25) % 10 + 658];\n v5[629 - v4] = v5[(gUnk_03005220 << 20 >> 25) % 10 + 690];\n return v3;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":88,"lines":57,"gotos":0,"casts":12,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["no scorable candidate for 'UpdateHUDCounterDisplay': agbcc failed: /c.c:1087: 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:1084: invalid operands to binary <<","/c.c:1097: invalid operands to binary <<","/c.c:1099: request for member `unk0' in something not a structure or union","/c.c:1100: request for member `unk0' in something not a structure or union","/c.c:1100: 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-f8b523f02efa.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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/macabeus/kl-eod-decomp/blob/ebe9bd0eccaa3a763a96321af92e17fdede003c4/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-f8b523f02efa.i.gz","asmlift":{"decompiler":"asmlift","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-f8b523f02efa.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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/macabeus/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},"m4aSoundVSync":{"params":0,"returnsVoid":true},"m4aSoundMain":{"params":0,"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","outcome":"match","source":"void VBlankHandlerMinimal(void) {\n m4aSoundVSync();\n m4aSoundMain();\n *(u16 *)50364408 = 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":6,"gotos":0,"casts":2,"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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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 \"m4aSoundVSync\": {\n \"params\": 0,\n \"returnsVoid\": true\n },\n \"m4aSoundMain\": {\n \"params\": 0,\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/macabeus/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},"ReadUnalignedU16":{"params":1}},"asmlift":{"decompiler":"asmlift","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:1072: conflicting types for `ReadUnalignedU16'","/c.c:1070: previous declaration of `ReadUnalignedU16'","/c.c:1078: warning: dereferencing `void *' pointer","/c.c:1078: request for member `unk2' in something not a structure or union","/c.c:1078: 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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 \"ReadUnalignedU16\": {\n \"params\": 1\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/mariopartyrd/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 /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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/mariopartyrd/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 /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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/mariopartyrd/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 /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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/mariopartyrd/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 /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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/mariopartyrd/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 /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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/mariopartyrd/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 /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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/mariopartyrd/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 /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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/mariopartyrd/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 /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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/mariopartyrd/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 /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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/mariopartyrd/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 /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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/mariopartyrd/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 /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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/mariopartyrd/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 /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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/mariopartyrd/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 /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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/mariopartyrd/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 /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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/mariopartyrd/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 /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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/mariopartyrd/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 /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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/mariopartyrd/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 /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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/mariopartyrd/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 /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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/mariopartyrd/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 /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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/mariopartyrd/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 /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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/mariopartyrd/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 /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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/mariopartyrd/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 /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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/mariopartyrd/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 /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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/mariopartyrd/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 /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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/mariopartyrd/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 /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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/mariopartyrd/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 /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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/mariopartyrd/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 /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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/mariopartyrd/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 /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","outcome":"declined","source":"/* asmlift could not decompile 'GWBoardRecordGet' — contract: structuring emitted ill-typed C in 'GWBoardRecordGet': interior pointer arithmetic on the global address '&GwCommon' (+1 more) */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\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... */\nvoid GWBoardRecordGet(void) {\n ASMLIFT_ERROR(\"could not decompile (contract): structuring emitted ill-typed C in 'GWBoardRecordGet': interior pointer arithmetic on the global address '&GwCommon' (+1 more)\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":35,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["contract: structuring emitted ill-typed C in 'GWBoardRecordGet': interior pointer arithmetic on the global address '&GwCommon' (+1 more)"]},"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":null,"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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/mariopartyrd/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 /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","outcome":"match","source":"void GWMgNoSet(u32 a0) {\n ((u8 *)&GwSystem)[16] = 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":1,"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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/mariopartyrd/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 /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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/mariopartyrd/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 /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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/mariopartyrd/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 /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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 /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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/pret/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/pret/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/pret/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/pret/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/pret/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","proto":{"Sin2":{"params":1}},"asmlift":{"decompiler":"asmlift","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"Sin2\": {\n \"params\": 1\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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 --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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/pret/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/pret/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/pret/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","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":94,"lines":15,"gotos":0,"casts":5,"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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/pret/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","proto":{"DecryptBerryPowder":{"params":1},"SetBerryPowder":{"returnsVoid":true,"params":2}},"asmlift":{"decompiler":"asmlift","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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 prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"DecryptBerryPowder\": {\n \"params\": 1\n },\n \"SetBerryPowder\": {\n \"returnsVoid\": true,\n \"params\": 2\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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 --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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/pret/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/pret/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","outcome":"nonmatch","source":"void LoadWordFromTwoHalfwords(u16 * a0, s32 * a1) {\n *a1 = *a0 | *a0 << 16;\n return;\n}\n","score":6,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":1,"opMismatch":0,"argMismatch":3},"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":6,"maxScore":7,"ratio":0.8571428571428571,"kinds":{"insert":0,"delete":2,"replace":1,"opMismatch":0,"argMismatch":3}},"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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/pret/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/pret/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/pret/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/pret/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/pret/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/pret/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/pret/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","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 = ((u8 *)&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":48,"maxScore":60,"compileErrors":null,"breakdown":{"insert":14,"delete":14,"replace":10,"opMismatch":1,"argMismatch":9},"quality":{"score":84,"lines":19,"gotos":0,"casts":12,"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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/pret/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},"PutMemBlockHeader":{"returnsVoid":true,"params":4}},"asmlift":{"decompiler":"asmlift","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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 \"PutMemBlockHeader\": {\n \"returnsVoid\": true,\n \"params\": 4\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/pret/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/pret/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/pret/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/pret/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/pret/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/pret/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/pret/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","proto":{"StringCopy":{"params":2}},"asmlift":{"decompiler":"asmlift","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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 prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"StringCopy\": {\n \"params\": 2\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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 --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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/pret/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/pret/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/pret/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/pret/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/pret/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/pret/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","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":84,"lines":19,"gotos":1,"casts":4,"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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/SAT-R/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/SAT-R/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/SAT-R/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/SAT-R/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/SAT-R/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/SAT-R/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},"InputRecorderRead":{"params":0},"InputRecorderWrite":{"params":1,"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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 \"InputRecorderRead\": {\n \"params\": 0\n },\n \"InputRecorderWrite\": {\n \"params\": 1,\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/SAT-R/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/SAT-R/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/SAT-R/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/SAT-R/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/SAT-R/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/SAT-R/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","proto":{"memcpy":{"params":3}},"asmlift":{"decompiler":"asmlift","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\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# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"memcpy\": {\n \"params\": 3\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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 --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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/SAT-R/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/SAT-R/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/SAT-R/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/SAT-R/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","outcome":"nonmatch","source":"struct Struct0 { s16 field_0; u8 _pad0[6]; s32 field_8; s32 field_12; };\nstruct Struct1 { s16 field_0; u8 _pad0[6]; s32 field_8; s32 field_12; };\nstruct Struct2 { u16 field_0; u16 field_2; u16 field_4; s32 field_8; s32 field_12; };\nvoid sa2__sub_8083504(struct Struct1 * a0, struct Struct0 * a1, struct Struct2 * 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 = a1->field_0;\n if (v0 == 128 << 3) {\n v4 = a0->field_8;\n } else {\n v1 = a0->field_8;\n a2->field_2 = a0->field_0 * v0 >> 10;\n v4 = v1 * v0 >> 10;\n }\n v2 = a1->field_0;\n if (v2 == 128 << 3) {\n v5 = a0->field_12;\n } else {\n v3 = a0->field_12;\n a2->field_4 = a0->field_0 * 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":87,"maxScore":124,"compileErrors":null,"breakdown":{"insert":16,"delete":14,"replace":14,"opMismatch":4,"argMismatch":39},"quality":{"score":100,"lines":40,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"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":87,"maxScore":124,"ratio":0.7016129032258065,"kinds":{"insert":16,"delete":14,"replace":14,"opMismatch":4,"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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/SAT-R/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","outcome":"nonmatch","source":"void sa2__sub_80838CC(s16 * a0, s16 * a1, u16 * a2) {\n *a2 = *a1 * *a0 + *a1 * *a0 + *a1 * *a0 - *a1 * *a0 >> 10;\n a2[1] = *a1 * *a0 - *a1 * *a0 + *a1 * *a0 + *a1 * *a0 >> 10;\n a2[2] = *a1 * *a0 + *a1 * *a0 - *a1 * *a0 + *a1 * *a0 >> 10;\n a2[3] = *a1 * *a0 - *a1 * *a0 - *a1 * *a0 - *a1 * *a0 >> 10;\n return;\n}\n","score":95,"maxScore":107,"compileErrors":null,"breakdown":{"insert":3,"delete":70,"replace":3,"opMismatch":0,"argMismatch":19},"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":95,"maxScore":107,"ratio":0.8878504672897196,"kinds":{"insert":3,"delete":70,"replace":3,"opMismatch":0,"argMismatch":19}},"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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/SAT-R/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","outcome":"nonmatch","source":"void sa2__sub_808399C(s16 * a0, s16 * a1) {\n s32 v0;\n s32 v1;\n s32 v2;\n v0 = *a0;\n v1 = *a0;\n v2 = *a0;\n *a0 = *a1 * *a0 + *a1 * v0 + *a1 * v1 - *a1 * v2 >> 10;\n a0[1] = *a1 * *a0 - *a1 * v0 + *a1 * v1 + *a1 * v2 >> 10;\n a0[2] = *a1 * *a0 + *a1 * v0 - *a1 * v1 + *a1 * v2 >> 10;\n a0[3] = *a1 * *a0 - *a1 * v0 - *a1 * v1 - *a1 * v2 >> 10;\n return;\n}\n","score":78,"maxScore":87,"compileErrors":null,"breakdown":{"insert":1,"delete":48,"replace":2,"opMismatch":0,"argMismatch":27},"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":78,"maxScore":87,"ratio":0.896551724137931,"kinds":{"insert":1,"delete":48,"replace":2,"opMismatch":0,"argMismatch":27}},"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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/SAT-R/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/SAT-R/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/SAT-R/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/SAT-R/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/SAT-R/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/SAT-R/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/SAT-R/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/SAT-R/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/SAT-R/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/SAT-R/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/SAT-R/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/SAT-R/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/SAT-R/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","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 (((u16 *)&gVramHeapState)[v1] != 0) {\n v2 = (u16)(v2 + ((u16 *)&gVramHeapState)[v1]);\n v1 = (u16)(((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":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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/SAT-R/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/cdlewis/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","outcome":"declined","source":"/* asmlift could not decompile 'func_80014440_15040' — contract: structuring emitted ill-typed C in 'func_80014440_15040': interior pointer arithmetic on the global address '&gDefaultFontPalette' */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\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... */\nvoid func_80014440_15040(void) {\n ASMLIFT_ERROR(\"could not decompile (contract): structuring emitted ill-typed C in 'func_80014440_15040': interior pointer arithmetic on the global address '&gDefaultFontPalette'\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":22,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["contract: structuring emitted ill-typed C in 'func_80014440_15040': interior pointer arithmetic on the global address '&gDefaultFontPalette'"]},"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":"m2c","score":8,"maxScore":14,"ratio":0.5714285714285714,"kinds":{"insert":1,"delete":1,"replace":1,"opMismatch":0,"argMismatch":5}},"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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/cdlewis/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/cdlewis/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/cdlewis/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/cdlewis/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/cdlewis/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/cdlewis/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/cdlewis/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/cdlewis/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/cdlewis/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/cdlewis/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/cdlewis/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/cdlewis/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/cdlewis/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/cdlewis/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/cdlewis/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/cdlewis/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/cdlewis/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","outcome":"nonmatch","source":"u32 func_80037FE0_38BE0(u32 a0) {\n return (((u8 *)(EepromSaveData + (a0 & 255)))[16] ^ 1) < 1;\n}\n","score":9,"maxScore":13,"compileErrors":null,"breakdown":{"insert":5,"delete":0,"replace":1,"opMismatch":0,"argMismatch":3},"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":{"decompiler":"asmlift","score":9,"maxScore":13,"ratio":0.6923076923076923,"kinds":{"insert":5,"delete":0,"replace":1,"opMismatch":0,"argMismatch":3}},"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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/cdlewis/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","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 = ((u8 *)EepromSaveData)[78];\n break;\n case 7:\n v0 = ((u8 *)EepromSaveData)[79];\n break;\n default:\n v0 = ((u8 *)EepromSaveData)[80];\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":94,"lines":18,"gotos":0,"casts":3,"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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/cdlewis/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/cdlewis/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/cdlewis/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/cdlewis/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/cdlewis/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/cdlewis/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/cdlewis/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/cdlewis/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/cdlewis/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/cdlewis/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/cdlewis/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/cdlewis/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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/cdlewis/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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\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\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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: the benchmark scored candidates inside the project's own typedef context; this\n# standalone score uses the plain typedef prelude, so a compile-sensitive candidate may grade\n# differently than the published row)\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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","outcome":"nonmatch","source":"struct Struct0 { s16 field_0; s32 field_4; };\ns32 smixed(struct Struct0 * a0) {\n return a0->field_0 + a0->field_4;\n}\n","score":1,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1},"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.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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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","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# (apps/benchmark/README lists the env vars; .github/workflows/benchmark.yml shows a complete\n# from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against 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-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 diff --git a/apps/web/src/pages/benchmark/lib/explorer-url.ts b/apps/web/src/pages/benchmark/lib/explorer-url.ts index c9ff42fe..ff444625 100644 --- a/apps/web/src/pages/benchmark/lib/explorer-url.ts +++ b/apps/web/src/pages/benchmark/lib/explorer-url.ts @@ -30,6 +30,8 @@ export const FILTER_PARSERS = { verdict: parseAsStringLiteral(VERDICTS).withDefault(''), feature: parseAsString.withDefault(''), decline: parseAsString.withDefault(''), + // 'with' = only rows asmlift ran WITH the project's symbol map (asmlift.symbolMap provenance) + symbols: parseAsStringLiteral(['', 'with'] as const).withDefault(''), search: parseAsString.withDefault(''), }; @@ -44,6 +46,7 @@ export const FILTER_URL_KEYS = { verdict: 'vs', feature: 'feature', decline: 'decline', + symbols: 'symbols', search: 'q', } as const; @@ -61,5 +64,6 @@ export const FILTERS_RESET: { [K in keyof Filters]: null } = { verdict: null, feature: null, decline: null, + symbols: null, search: null, }; diff --git a/apps/web/src/pages/playground/Pipeline.tsx b/apps/web/src/pages/playground/Pipeline.tsx index 2c984f94..3427ea9f 100644 --- a/apps/web/src/pages/playground/Pipeline.tsx +++ b/apps/web/src/pages/playground/Pipeline.tsx @@ -10,6 +10,15 @@ import type { Ranking } from './useRanking'; const dump = 'scroll-slim overflow-x-auto whitespace-pre rounded bg-slate-950/70 p-2 font-mono text-[11px] leading-relaxed text-slate-300'; +// One-sentence stage descriptions for behavior a single run's dump cannot show on its own — +// what a symbol map changes at each end of the tower. +const STAGE_DESCRIPTIONS: Record = { + 'stage:lift': + 'With a symbol map, numeric pool words matching a mapped address lift as named gaddr ops instead of raw constants — visible in the IR dump.', + 'stage:structure': + 'Symbol-map declaration shapes are spelled here: a struct global becomes a dot-field (gState.timer), an array global a bare element (gTable[i]).', +}; + function PatternCard({ ev }: { ev: PatternEvent }) { return (
@@ -52,6 +61,9 @@ function StageCard({ stage, changed, events }: { stage: StageTrace; changed: boo {stage.irDump !== undefined &&
{stage.irDump}
} + {STAGE_DESCRIPTIONS[stage.id] && ( +

{STAGE_DESCRIPTIONS[stage.id]}

+ )} {events.map((ev) => ( ))} diff --git a/apps/web/src/pages/playground/Playground.tsx b/apps/web/src/pages/playground/Playground.tsx index acca5654..9d7ea155 100644 --- a/apps/web/src/pages/playground/Playground.tsx +++ b/apps/web/src/pages/playground/Playground.tsx @@ -19,6 +19,7 @@ import { Pipeline } from './Pipeline'; import { RankBadge } from './RankPanel'; import { deriveSpec, parseSpec } from './cpp-spec'; import { EXAMPLES } from './examples'; +import { parseSymbolsJson } from './symbols-json'; import { useRanking } from './useRanking'; const TARGETS: Record = { @@ -40,6 +41,10 @@ const SPEC_PLACEHOLDER = `optional — auto-derived from the mangled symbol when "params":[{"name":"o","type":{"base":"Vec","ptr":1}}], "classes":{"Vec":{"fields":[{"name":"x","type":{"base":"int","ptr":0}},{"name":"y","type":{"base":"int","ptr":0}}]}}}`; +const SYMBOLS_PLACEHOLDER = `optional — the project's address→symbol map (hex address → SymbolInfo[]), e.g. +{"0x03001234": [{"name": "gCounter", "kind": "data"}], + "0x08012344": [{"name": "DoThing", "kind": "code"}]}`; + type Tab = 'source' | 'pipeline'; const TABS: { id: Tab; label: string }[] = [ { id: 'source', label: 'Source' }, @@ -72,16 +77,19 @@ export function Playground({ const [asm, setAsm] = useState(initial?.asm ?? EXAMPLES[0].asm); const [nameOverride, setNameOverride] = useState(initial?.name ?? ''); const [specText, setSpecText] = useState(initial?.spec ?? ''); - const [debounced, setDebounced] = useState({ asm, targetId, backendId, nameOverride, specText }); + const [symbolsText, setSymbolsText] = useState(initial?.symbols ?? ''); + // The Symbols pane is collapsed by default when empty; a share/preset that carries a map opens it. + const [symbolsOpen, setSymbolsOpen] = useState(!!initial?.symbols); + const [debounced, setDebounced] = useState({ asm, targetId, backendId, nameOverride, specText, symbolsText }); const [tab, setTab] = useState('source'); const [copied, setCopied] = useState<'idle' | 'copied' | 'huge' | 'failed'>('idle'); // The last ?s= WE wrote, encoded — tells external changes apart from our own writes echoing back. const lastWritten = useRef(initial ? encodeShare(initial) : null); useEffect(() => { - const t = setTimeout(() => setDebounced({ asm, targetId, backendId, nameOverride, specText }), 250); + const t = setTimeout(() => setDebounced({ asm, targetId, backendId, nameOverride, specText, symbolsText }), 250); return () => clearTimeout(t); - }, [asm, targetId, backendId, nameOverride, specText]); + }, [asm, targetId, backendId, nameOverride, specText, symbolsText]); // An EXTERNAL ?s= change (Back/Forward, the Benchmark's "Open in playground") loads into the // editor. Own writes are skipped via lastWritten, so a debounced (250ms-old) echo can never @@ -101,6 +109,8 @@ export function Playground({ setAsm(s.asm); setNameOverride(s.name ?? ''); setSpecText(s.spec ?? ''); + setSymbolsText(s.symbols ?? ''); + setSymbolsOpen(!!s.symbols); setTab('source'); // Seed the debounced snapshot too, so an incoming share decompiles at once — no transient // where the write effect re-encodes the previous content over the new share. @@ -110,6 +120,7 @@ export function Playground({ backendId: s.backend, nameOverride: s.name ?? '', specText: s.spec ?? '', + symbolsText: s.symbols ?? '', }); }, [urlShare]); @@ -126,11 +137,19 @@ export function Playground({ asm: debounced.asm, ...(debounced.nameOverride.trim() ? { name: debounced.nameOverride.trim() } : {}), ...(debounced.backendId === 'cpp' && debounced.specText.trim() ? { spec: debounced.specText } : {}), + ...(debounced.symbolsText.trim() ? { symbols: debounced.symbolsText } : {}), }; lastWritten.current = encodeShare(state); void setUrlShare(state); }, [debounced, active, setUrlShare]); + // The Symbols pane's map, parsed on the same debounce as the decompile. A parse error is loud + // in the pane but INERT to the run: the decompile proceeds WITHOUT the map — degrade, never + // block (core's own optionality contract for `symbols`). + const symbolsParse = useMemo(() => parseSymbolsJson(debounced.symbolsText), [debounced.symbolsText]); + const symbolMap = symbolsParse && 'map' in symbolsParse ? symbolsParse.map : undefined; + const symbolsError = symbolsParse && 'error' in symbolsParse ? symbolsParse.error : null; + const detected = useMemo(() => detectName(debounced.asm), [debounced.asm]); const override = debounced.nameOverride.trim(); const fnName = override || detected; @@ -149,12 +168,18 @@ export function Playground({ const target = TARGETS[debounced.targetId].desc; const spec = debounced.specText.trim() ? parseSpec(debounced.specText) - : deriveSpec(fnName, decompile(fnName, debounced.asm, target, { onGap: 'annotate' }).sfn); + : deriveSpec( + fnName, + decompile(fnName, debounced.asm, target, { + onGap: 'annotate', + ...(symbolMap ? { symbols: symbolMap } : {}), + }).sfn, + ); return { backend: cppBackend(spec) }; } catch (e) { return { error: e instanceof Error ? e.message : String(e) }; } - }, [debounced, fnName]); + }, [debounced, fnName, symbolMap]); const result: DecompileResult | { error: string } | null = useMemo(() => { if (!debounced.asm.trim()) { @@ -176,11 +201,12 @@ export function Playground({ return decompile(fnName, debounced.asm, TARGETS[debounced.targetId].desc, { backend: langBackend.backend, onGap: 'annotate', + ...(symbolMap ? { symbols: symbolMap } : {}), }); } catch (e) { return { error: e instanceof Error ? e.message : String(e) }; } - }, [debounced, fnName, nameInvalid, langBackend]); + }, [debounced, fnName, nameInvalid, langBackend, symbolMap]); // The Pipeline tab's trace — computed only while that tab is open (a second tower run). // A thrown trace is an ERROR result (rendered as such), never a silently blank panel. @@ -200,12 +226,13 @@ export function Playground({ report: decompileTraced(fnName, debounced.asm, TARGETS[debounced.targetId].desc, { backend: langBackend.backend, onGap: 'annotate', + ...(symbolMap ? { symbols: symbolMap } : {}), }).report, }; } catch (e) { return { error: e instanceof Error ? e.message : String(e) }; } - }, [debounced, fnName, nameInvalid, langBackend, tab]); + }, [debounced, fnName, nameInvalid, langBackend, tab, symbolMap]); const ok = result !== null && !('error' in result); const diagnostics = ok ? result.diagnostics : []; @@ -221,12 +248,18 @@ export function Playground({ !!fnName && !nameInvalid && !!debounced.asm.trim(); + // Symbol-mapped runs rank too: the worker enumerates the named spellings alongside + // '/raw-globals' and compiles each self-declared — core's declaration synthesis + // (@asmlift/core/declare, the same renderer the cli scorer prepends), so a map-named + // candidate scores instead of silently losing to its raw sibling. A parse-errored Symbols + // pane leaves symbolMap undefined — ranked raw, matching the decompile it sits beside. const ranking = useRanking({ eligible: rankEligible, asm: debounced.asm, name: fnName, targetId: debounced.targetId, target: rankTarget, + ...(symbolMap ? { symbols: symbolMap } : {}), }); // The Source view shows the RANKED-BEST C when scoring has resolved for the current input; // otherwise the deterministic decompile (instant, and the fallback if ranking is off/loading/ @@ -253,6 +286,8 @@ export function Playground({ setTargetId(ex.target); setBackendId(ex.backend ?? 'c'); setSpecText(ex.spec ?? ''); + setSymbolsText(ex.symbols ?? ''); + setSymbolsOpen(!!ex.symbols); setAsm(ex.asm); setNameOverride(''); setTab('source'); @@ -369,6 +404,40 @@ export function Playground({ basicSetup={{ foldGutter: false }} />
+
+ + {symbolsOpen && ( +
+